Skip to content

Convert Learn GDScript App to Godot 4.6#1248

Open
Razoric480 wants to merge 86 commits intomainfrom
raz/learn_godot4
Open

Convert Learn GDScript App to Godot 4.6#1248
Razoric480 wants to merge 86 commits intomainfrom
raz/learn_godot4

Conversation

@Razoric480
Copy link
Copy Markdown
Collaborator

@Razoric480 Razoric480 commented Mar 20, 2026

Converts the whole of the app from the 3.6.2 custom build with GDScriptParserWrapper to a 4.6.2 custom build with a GDScriptErrorChecker. Both are uploaded to the Razoric480/custom-godot-builder repository.

Fixes #1187. Fixes #1259. Fixes #911. Fixes #1262.

Current State

Integration tests pass

Integration Test Log Integration Test results
RUNNING INTEGRATION TEST
Time scale: 4.0x
Course path: res://course/CourseLearnGDScriptIndex.gd

Course: Learn GDScript From Zero
Total lessons: 27
Total practices: 53

[Lesson 1/27] Testing: What Code is Like
  ERROR: Scene res://course/common/inventory/DictInventory.tscn doesn't have a run() function. The Run button won't work.
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  OK - Lesson loaded successfully
  [Practice 1/1] Testing: Try Your First Code
Welcome!
["Welcome!"]
    OK - Practice completed successfully

[Lesson 2/27] Testing: Your First Error
  OK - Lesson loaded successfully
  [Practice 1/1] Testing: Fix Your First Error
    OK - Practice completed successfully

[Lesson 3/27] Testing: We Stand on the Shoulders of Giants
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Make The Character Visible
    OK - Practice completed successfully
  [Practice 2/2] Testing: Make the Robot Upright
    OK - Practice completed successfully

[Lesson 4/27] Testing: Drawing a Rectangle
  OK - Lesson loaded successfully
  [Practice 1/3] Testing: Drawing a Corner
    OK - Practice completed successfully
  [Practice 2/3] Testing: Drawing a Rectangle
    OK - Practice completed successfully
  [Practice 3/3] Testing: Drawing a Bigger Rectangle
    OK - Practice completed successfully

[Lesson 5/27] Testing: Coding Your First Function
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: A function to draw squares
    OK - Practice completed successfully
  [Practice 2/2] Testing: Drawing multiple squares
    OK - Practice completed successfully

[Lesson 6/27] Testing: Your First Function Parameter
  OK - Lesson loaded successfully
  [Practice 1/4] Testing: Drawing corners of different sizes
    OK - Practice completed successfully
  [Practice 2/4] Testing: Using multiple parameters
    OK - Practice completed successfully
  [Practice 3/4] Testing: Drawing squares of any size
    OK - Practice completed successfully
  [Practice 4/4] Testing: Drawing rectangles of any size
    OK - Practice completed successfully

[Lesson 7/27] Testing: Introduction to Member Variables
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Draw a rectangle at a precise position
    OK - Practice completed successfully
  [Practice 2/2] Testing: Draw squares at different positions
    OK - Practice completed successfully

[Lesson 8/27] Testing: Defining Your Own Variables
  OK - Lesson loaded successfully
  [Practice 1/1] Testing: Define a health variable
    OK - Practice completed successfully

[Lesson 9/27] Testing: Adding and Subtracting
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Damaging the Robot
    OK - Practice completed successfully
  [Practice 2/2] Testing: Healing the Robot
    OK - Practice completed successfully

[Lesson 10/27] Testing: The Game Loop
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Rotating a Character Continuously
    OK - Practice completed successfully
  [Practice 2/2] Testing: Creating Circular Movement
    OK - Practice completed successfully

[Lesson 11/27] Testing: Time Delta
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Rotating Using Delta
    OK - Practice completed successfully
  [Practice 2/2] Testing: Moving in a Circle Using Delta
    OK - Practice completed successfully

[Lesson 12/27] Testing: Using Variables to Make Code Easier to Read
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Clarifying Code Using Variables
    OK - Practice completed successfully
  [Practice 2/2] Testing: Fixing an Out of Scope Error
    OK - Practice completed successfully

[Lesson 13/27] Testing: Conditions
  OK - Lesson loaded successfully
  [Practice 1/3] Testing: Using Comparisons
["health is greater than five."]
["One is less than health."]
["health is equal to health"]
["health is not equal to seven."]
    OK - Practice completed successfully
  [Practice 2/3] Testing: Limiting Healing
    OK - Practice completed successfully
  [Practice 3/3] Testing: Preventing Health from Going Below Zero
    OK - Practice completed successfully

[Lesson 14/27] Testing: Multiplying
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Increasing maximum health exponentially
    OK - Practice completed successfully
  [Practice 2/2] Testing: Reducing damage at higher levels
    OK - Practice completed successfully

[Lesson 15/27] Testing: 2D Vectors
  ERROR: Scene res://course/lesson-16-2d-vectors/visuals/VectorVisual.tscn doesn't have a run() function. The Run button won't work.
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Increasing scale using vectors
    OK - Practice completed successfully
  [Practice 2/2] Testing: Resetting size and position using vectors
    OK - Practice completed successfully

[Lesson 16/27] Testing: Introduction to While Loops
  OK - Lesson loaded successfully
  [Practice 1/1] Testing: Moving to the end of a board
    OK - Practice completed successfully

[Lesson 17/27] Testing: Introduction to For Loops
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Using a for loop to move to the end of the board
    OK - Practice completed successfully
  [Practice 2/2] Testing: Improving code with a for loop
    OK - Practice completed successfully

[Lesson 18/27] Testing: Creating arrays
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Walking to the robot
    OK - Practice completed successfully
  [Practice 2/2] Testing: Selecting units
    OK - Practice completed successfully

[Lesson 19/27] Testing: Looping over arrays
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Move the robot along the path
    OK - Practice completed successfully
  [Practice 2/2] Testing: Back to the drawing board
    OK - Practice completed successfully

[Lesson 20/27] Testing: Strings
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Creating string variables
["Hi, Robi!"]
    OK - Practice completed successfully
  [Practice 2/2] Testing: Using an array of strings to play a combo
    OK - Practice completed successfully

[Lesson 21/27] Testing: Functions that return a value
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  ERROR: Scene  doesn't have a run() function. The Run button won't work.
  OK - Lesson loaded successfully
  [Practice 1/1] Testing: Converting coordinates from the grid to the screen
    OK - Practice completed successfully

[Lesson 22/27] Testing: Appending and popping values from arrays
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Completing orders
["completing order `tomato soup`"]
["completing order `toast`"]
["completing order `burger`"]
["completing order `cheese sandwich`"]
    OK - Practice completed successfully
  [Practice 2/2] Testing: Clearing up the crates
["popping crate 3 \'sword\'"]
["popping crate 2 \'gems\'"]
["popping crate 1 \'shield\'"]
["popping crate 0 \'healing heart\'"]
    OK - Practice completed successfully

[Lesson 23/27] Testing: Accessing values in arrays
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Using the right items
["using item 6: \"sword\""]
["using item 8: \"shield\""]
["used items: [\"sword\", \"shield\"]"]
    OK - Practice completed successfully
  [Practice 2/2] Testing: Realigning the train tracks
    OK - Practice completed successfully

[Lesson 24/27] Testing: Creating Dictionaries
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Creating an inventory using a dictionary
    OK - Practice completed successfully
  [Practice 2/2] Testing: Increasing item counts
    OK - Practice completed successfully

[Lesson 25/27] Testing: Looping over dictionaries
  ERROR: Scene res://course/common/inventory/DictInventory.tscn doesn't have a run() function. The Run button won't work.
  ERROR: Scene res://course/lesson-26-looping-over-dictionaries/GameBoard.tscn doesn't have a run() function. The Run button won't work.
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Displaying the inventory
    OK - Practice completed successfully
  [Practice 2/2] Testing: Placing units on the board
    OK - Practice completed successfully

[Lesson 26/27] Testing: Value types
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Displaying the player's health and energy
    OK - Practice completed successfully
  [Practice 2/2] Testing: Letting the player type numbers
    OK - Practice completed successfully

[Lesson 27/27] Testing: Specifying types with type hints
  OK - Lesson loaded successfully
  [Practice 1/2] Testing: Add the correct type hints to variables
    OK - Practice completed successfully
  [Practice 2/2] Testing: Fix the values to match the type hints
    OK - Practice completed successfully


==================================================
Test Summary
==================================================
Total lessons tested: 27
Total practices tested: 53
Tests passed: 53 / 53
Failures: 0
Timeouts: 0

OK - All tests passed!
  • Currently deployed to staging gh-pages
  • Entire project has been converted to Godot 4, from the main menu up to the ending screen.
  • Large bugs have mostly been dealt with, but there are likely still some smaller ones
  • Font size and font resource overrides have been replaced with Theme Variations

Potential issues

  • Various pages had so many renames between godot 3 and 4 that the auto-converter didn't even bother. RichTextLabel adjust_height didn't get ported to fit_content so I had to find those, for example. Particle settings were only marginally converted.

Some internals to keep in mind

  • Coroutine code examples used yield() with GDScriptFunctionState to step through a function. Instead, I've split those up to have either a run() (no coroutines or stepping) or a run_coroutine(CoroutineController). yield() is replaced with await coroutine_controller.step_requested, and run_coroutine() should end with an coroutine_controller.finished.emit().
  • Web release uses no-threads to maximize compatibility.
  • Uses the gl_compat renderer to maximize compatibility and web support.
  • As a bonus, we include the GDScriptAnalyzer in the offline script verifier, allowing us to catch some errors that would crash at runtime in the godot 3 version

Conversion gotchas I ran into

  • DynamicFont were all auto-converted to FontFile and were all broken. I had to convert them all to FontVariation and re-assign the main font + fallback.
    • Font sizes is no longer part of the font variation - they are stored as a Font Size theme override. I assigned Theme Variations wherever a font size or font was requested, which required a change to the Theme Manager.
  • TileMapLayer's map_to_local() is centered, whereas TileMap's map_to_world() was top left corner
  • String manipulation: godot 3's right() function gave you the characters to the right of the index. godot 4's right() gives you X characters from the right side (which, to be fair, matches what left() does).
  • super._ready() and the like are no longer implicit and need to be called explicitly. I think I've found most of them but it's possible I've missed some.
  • Some of the RichTextLabels were copied by the auto-converter by their display text and not by their BBCode

Additional improvements and changes

Some are just general improvements, others were requested changes to app functionality.

  • Removing scroll-to-block restoration, since lessons are so short, to simplify IDing.
  • Remove keeping track of read lesson block in favour of just "did read the lesson" (which translates to the practice buttons came into view of the camera)
  • Simplified URL slug system

@NathanLovato
Copy link
Copy Markdown
Contributor

Made a couple more changes, notably removed the import cache folder from git tracking and updated the signal connections and the likes + corrected errors in the revealer script.

@NathanLovato
Copy link
Copy Markdown
Contributor

One small note on something I just noticed: In the UI practice scene, there's a CodeHighlighter resource embedded. I think it's a resource we would want to share across all code editors across the application, but I couldn't find where it is in the scene to extract it as a reusable resource.

@Razoric480
Copy link
Copy Markdown
Collaborator Author

I did extract a re-usable TRES, but I must have missed that one. I'll see about tracking it down.

@NathanLovato
Copy link
Copy Markdown
Contributor

Thank you for all the work! I'm doing some quick testing and below are some things that I stumbled upon:

01. CPU usage is high

This is probably the most substantial thing I could see so far. looking at the application maxes out one thread on this end. This happens on any screen for me. It'd be great if we could identify what is causing it, and if it can be mitigated. There's probably the cost of running debug builds. Perhaps there's also the low processor mode that was turned off when porting.

Perhaps also there's something causing excessive layout operations or something with the fact that we have a master scene with a lot of UI. It doesn't have to be all fixed before merging, but at least it would be great to profile, measure, investigate the costs and the causes and see if there are some low-hanging fruit changes we can make for an initial release and what we can do beyond that.

02. Quiz gets larger on answer

When skipping or answering a quiz the quiz box can get larger and cause the entire lesson to expand horizontally. I'm suspecting it might be the answer line that is not set to wrap text.

image

03. GDQuest credits label at the bottom is cropped

There's a GDQuest label at the bottom right of the app. It's overflowing the window. The font is also a bit larger than the original.

image

Here's how it is meant to look.

image

04. Breadcrumb texts are not neatly aligned anymore

The lesson breadcrumb text is larger than the current practice breadcrumb text. You will see it's particularly noticeable when clicking on the breadcrumb link to go back to the lesson. The font noticeably jumps in size.

image

This is how the breadcrumb texts are meant to be sized, same height and aligned:.

image

05. Lesson index looks a bit different

quick list of differences I could spot:

  • The background behind lessons has a lighter color. Original has no visible background (or background is same color as panel)
  • The progress bar fill color is pure gray instead of a blue purple gray
  • Lesson title label in the right column does not wrap
image

Previous:

image

06. The code font is different

I'm not sure if we used a custom monospace font before. If not, this is just a reminder that we should replace the default font that Godot 4 is using, probably.

@NathanLovato
Copy link
Copy Markdown
Contributor

I'll throw in a little extra feature, could you add resolution support? In particular, not locking to 1080p and allowing up to 4k resolution, possibly with a dropdown menu in the settings?

#1183

I'm throwing this in now and it could be part of this PR because if we're going to test the app and review the visuals, we might as well do it at high resolution so we can catch any icons or resources that need to be tweaked to look crisp.

@NathanLovato
Copy link
Copy Markdown
Contributor

07. the settings do not work for the most part

This is probably one general area to review. Changing the text size setting does not change the text size, the dyslexia font is not activating, changing language is not working...

I'll let you investigate what's happening. Notice also the checkboxes have the text jittering when clicking or when hovering quickly.

Here, if you pay attention, the bottom checkbox text is a bit more to the left than the top one. Also, the text is not vertically aligned with the checkbox nicely.

image

@NathanLovato
Copy link
Copy Markdown
Contributor

09. Smooth scrolling is a bit jittery on Firefox (Linux)

This is a bit hard to describe, so I made you a video clip to show you how it works on my end. It's only happening with Firefox.

I've reduced the scroll sensitivity to the minimum here and when I'm slowly turning the wheel, the motion is somewhat smooth (and slow according to the scroll sensitivity setting), but if I start turning the wheel faster, the bar makes sudden jumps.

I remember then that back in the day, I had problems with excessive events being emitted input-wise very differently between browsers and the desktop. I don't know if that might be the case, but probably the scroll algorithm could use some tweaks to normalize the flow of input events. Also with touchpads, the input events tend to be every single frame. And work differently from the mouse wheel.as users would probably want to control the scrolling a bit more, but we don't really support that.

Video_2026-03-25_21-38-05.mp4

Now, for this issue specifically, this can be briefly investigated and then offloaded to a new issue to address later. Or a quick fix can be implemented for the firefox hiccups now and an issue opened for reworking smooth scrolling.

@Razoric480
Copy link
Copy Markdown
Collaborator Author

Razoric480 commented Mar 25, 2026

Just tracking these:

  • Profile performance
  • Quiz changes size due to answers not being word wrapped
  • GDQuest Credit Label
  • Breadcrumbs font sizes
  • Course Lesson Items styling (progress bar's panel styles changed names, and should use is_selected and not selected in draw function)
  • Code Font
  • Settings
  • Smooth scrolling
  • Resolution support deferring

@Razoric480
Copy link
Copy Markdown
Collaborator Author

Razoric480 commented Mar 26, 2026

After some testing, I've figured out that there's a bug with web export apps where the low_processor_usage_mode_sleep_usec seems to have the inverse effect on CPU usage on web than it does on desktop. Opened a ticket here: godotengine/godot#117875

Current workaround has to be to disable low CPU mode until that's fixed, which does mean losing access to FPS limits on web, as currently Engine.max_fps and low_processor_usage_mode_sleep_usec both clobber the CPU.

@Razoric480
Copy link
Copy Markdown
Collaborator Author

Firefox seems to provide scrolling factors that are half the size to Chrome's, but possibly more often. I've made it use InputEvent's factor to calculate a change delta. It seems to normalize the movement between them.

@NathanLovato
Copy link
Copy Markdown
Contributor

If you happen to be developing on Windows, could you test the Windows magnifier (accessibility option) on the desktop export? It was incompatible with godot 3 but if it works with 4 we can mark this PR as closing #1213

@Razoric480
Copy link
Copy Markdown
Collaborator Author

Razoric480 commented Mar 27, 2026

I switched to Fedora a couple months ago, but I still have my windows 11 boot on hand. However, I had no issues with magnifier zooming in with the app in full screen on either of the godot 3 or 4 ports of the app.

@Razoric480
Copy link
Copy Markdown
Collaborator Author

Going to defer the resolution stuff for now.

I did a couple tweaks to the core page to make it a bit more resize friendly on ultra wide (in that things will stay centred when full screen). I did spend a few hours toying with it and I found that:

  • Firefox has no issues with the canvas resize request, going back and forth with full screen
  • Chrome seems to semi-randomly choose between having a 1080p viewport inside full screen, or proper full screen
  • Letting Godot do the full screen itself by changing get_window().mode was more successful and would full screen properly on chrome
    • however, when doing that, there's something about the app's UI that causes buttons' click area to desync from their rendered location, at least on ultra wide. the full screen button looks like it should be where I expected it to be, but it's actually off on the right near the edge of the screen.
    • I tried to recreate the issue in a minimal project to file a bug ticket for the engine but I couldn't - the buttons worked fine there. So it's unique to our layout and I'm not sure how or why or what's different.

@Razoric480 Razoric480 marked this pull request as ready for review March 27, 2026 19:10
@Razoric480
Copy link
Copy Markdown
Collaborator Author

Pending additional testing and feedback, gonna green light the PR since it otherwise functions A to Z pretty well.

@NathanLovato
Copy link
Copy Markdown
Contributor

NathanLovato commented Mar 28, 2026

Thank you very much! Overall it's looking pretty good. This will be the last round for me, and after that I will have two testers go through the entire application and make a report.

A few more after some more testing:

  • The bottom right label that says Learn GDScript from Zero is an open source project by GDQuest is a bit better, but it's still cropped. The yellow link does not appear on my end
  • Settings: Applying configuration changes, when you click apply, is really slow. It hangs the application for a couple of seconds and triggers high CPU usage. This applies to changing any setting. (Tested in Chrome and Firefox, in normal and incognito window).
  • Settings: Applying the Dyslexia Font applies the font only in the settings on the sample text next to the Text Size setting at the moment
  • Settings: Framerate cap: should this setting be hidden/removed, at least temporarily or on the web? Based on your report in Web Export: Higher values of low_processor_usage_mode_sleep_usec increase CPU usage godotengine/godot#117875
  • Course index: long lesson titles still enlarge the right panel and shift the layout when selected. The text should probably wrap to avoid shifting the layout when selecting lessons

For the first item, expected:

image

Current:

image

For the course index, example:

image

@Razoric480
Copy link
Copy Markdown
Collaborator Author

Razoric480 commented Mar 28, 2026

I can't replicate the bottom right label. This is what it looks like on staging right now for me:

Nevermind. In the godot 3 app the credit label isn't affected by font changes, so that's likely what's happening. I've replicated this behaviour here.

@Razoric480
Copy link
Copy Markdown
Collaborator Author

Razoric480 commented Mar 28, 2026

The profile was saving multiple times. Not sure why it wasn't noticeable in the godot 3 version as it happened there too. Fixed it by queueing the save so that even if save() is called multiple times, it only happens once. There's still a bit of a spike but it's a lot less egregious. Not sure if there's been a change with ResourceSaver between godot 3 and 4 that made it a bit slower.

Alternatively would be to save/load with var_to_string and save one line at a time behind await process_frame, or to compile with threads support and save behind a thread.

@NathanLovato
Copy link
Copy Markdown
Contributor

NathanLovato commented Mar 29, 2026

Thanks.

I did a bit of testing and profiling because the lag remained long for me and saving multiple times itself should not have been too slow, although it's good that this has been cleaned up.

I found that the root issue was when we change the fonts in the theme, it caused lots of notifications and re-layouts. But excessively. In the profiler, strangely enough, the time spike was reported as physics time.

I managed to reduce it from 4000 ms to 500 ms by removing many references to theme resources. That's still quite long. I think this could be improved by producing fewer individual controls, notably lesson content blocks. Hopefully at least. The app could generally use a pass later on to simplify or consolidate the UI and theme etc., but maybe I will put Yuri on that when he is available (former Godot UI and theme system maintainer).

I'll do a bit more testing before pushing. I'm also adding some logic so if you change settings that are not related to theme resources it doesn't touch the theme and doesn't cause any re-layout so the change is perceptually instant.

Comment on lines +5 to +33
const LESSONS := {
"res://course/lesson-1-what-code-is-like/lesson.bbcode": "lesson-1-what-code-is-like/lesson.bbcode",
"res://course/lesson-2-your-first-error/lesson.bbcode": "lesson-2-your-first-error/lesson.bbcode",
"res://course/lesson-3-standing-on-shoulders-of-giants/lesson.bbcode": "lesson-3-standing-on-shoulders-of-giants/lesson.bbcode",
"res://course/lesson-4-drawing-a-rectangle/lesson.bbcode": "lesson-4-drawing-a-rectangle/lesson.bbcode",
"res://course/lesson-5-your-first-function/lesson.bbcode": "lesson-5-your-first-function/lesson.bbcode",
"res://course/lesson-6-multiple-function-parameters/lesson.bbcode": "lesson-6-multiple-function-parameters/lesson.bbcode",
"res://course/lesson-7-member-variables/lesson.bbcode": "lesson-7-member-variables/lesson.bbcode",
"res://course/lesson-8-defining-variables/lesson.bbcode": "lesson-8-defining-variables/lesson.bbcode",
"res://course/lesson-9-adding-and-subtracting/lesson.bbcode": "lesson-9-adding-and-subtracting/lesson.bbcode",
"res://course/lesson-10-the-game-loop/lesson.bbcode": "lesson-10-the-game-loop/lesson.bbcode",
"res://course/lesson-11-time-delta/lesson.bbcode": "lesson-11-time-delta/lesson.bbcode",
"res://course/lesson-12-using-variables/lesson.bbcode": "lesson-12-using-variables/lesson.bbcode",
"res://course/lesson-13-conditions/lesson.bbcode": "lesson-13-conditions/lesson.bbcode",
"res://course/lesson-14-multiplying/lesson.bbcode": "lesson-14-multiplying/lesson.bbcode",
"res://course/lesson-16-2d-vectors/lesson.bbcode": "lesson-16-2d-vectors/lesson.bbcode",
"res://course/lesson-17-while-loops/lesson.bbcode": "lesson-17-while-loops/lesson.bbcode",
"res://course/lesson-18-for-loops/lesson.bbcode": "lesson-18-for-loops/lesson.bbcode",
"res://course/lesson-19-creating-arrays/lesson.bbcode": "lesson-19-creating-arrays/lesson.bbcode",
"res://course/lesson-20-looping-over-arrays/lesson.bbcode": "lesson-20-looping-over-arrays/lesson.bbcode",
"res://course/lesson-21-strings/lesson.bbcode": "lesson-21-strings/lesson.bbcode",
"res://course/lesson-22-functions-return-values/lesson.bbcode": "lesson-22-functions-return-values/lesson.bbcode",
"res://course/lesson-23-append-to-arrays/lesson.bbcode": "lesson-23-append-to-arrays/lesson.bbcode",
"res://course/lesson-24-access-array-indices/lesson.bbcode": "lesson-24-access-array-indices/lesson.bbcode",
"res://course/lesson-25-creating-dictionaries/lesson.bbcode": "lesson-25-creating-dictionaries/lesson.bbcode",
"res://course/lesson-26-looping-over-dictionaries/lesson.bbcode": "lesson-26-looping-over-dictionaries/lesson.bbcode",
"res://course/lesson-27-value-types/lesson.bbcode": "lesson-27-value-types/lesson.bbcode",
"res://course/lesson-28-specifying-types/lesson.bbcode": "lesson-28-specifying-types/lesson.bbcode",
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'd say remove the lesson.bbcode, and also the lesson number: for example, the slug for res://course/lesson-8-defining-variables/lesson.bbcode would be just defining-variables: this way slugs don't change or depend on lesson numbers and we address this issue: #911

Moving forward we'll likely change, insert, or append lessons, so having l;esson numbers in slugs would be "invalidated" again.

To decide: doing something similar for practices? E.g. having cannonical urls like: $lessonSlug/$practiceSlug?

Because there again practice numbers may change, but unique slugs wouldn't. The main reason I'm putting this as a question is that the natural place to write slugs would be in the bbcode meaning to get the TOC we would need to parse all bbcode at startup.

@NathanLovato
Copy link
Copy Markdown
Contributor

By the way, at any point we can merge this work, for example, perhaps after finishing the URL slugs, so it ends up in main, and open issues and address and merge changes gradually (or directly commit changes to main), whichever is more comfortable for you. Just let me know if you'd like to merge and work in main vs keep working in this branch

@Razoric480
Copy link
Copy Markdown
Collaborator Author

Okay, I think at this point the app, with the new simplified slugs, is in a working condition well enough to get merged.

Next week I can start tackling outstanding bugs, newly opened tickets, and optimization. But it should be good to go to main now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants