feat: Create structure for guided tutorial of the language#1283
feat: Create structure for guided tutorial of the language#1283jderochervlk wants to merge 34 commits intomasterfrom
Conversation
…ng.org into vlk/monorepo-foundation
Move shared editor/compiler helpers into @rescript-lang/shared and the playground implementation into @rescript-lang/playground. Wire the docs app to consume both workspace packages and keep playground browser storage access safe during prerendering.
…-fix # Conflicts: # .gitignore # __tests__/SidebarLayout_.test.res # __tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-breadcrumbs-chromium-linux.png # __tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-breadcrumbs-deep-chromium-linux.png # __tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-category-active-item-chromium-linux.png # __tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-category-chromium-linux.png # __tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-category-many-items-chromium-linux.png # __tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-category-with-toc-chromium-linux.png # apps/docs/__tests__/LandingPage_.test.res # apps/docs/__tests__/SidebarLayout_.test.res # apps/docs/__tests__/SidebarNav_.test.res # apps/docs/__tests__/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-chromium-linux.png # apps/docs/__tests__/__screenshots__/Breadcrumbs_.test.jsx/sidebar-breadcrumbs-deep-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-breadcrumbs-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-breadcrumbs-deep-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-category-active-item-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-category-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-category-many-items-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarLayout_.test.jsx/sidebar-category-with-toc-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarNav_.test.jsx/sidebar-category-active-item-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarNav_.test.jsx/sidebar-category-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarNav_.test.jsx/sidebar-category-many-items-chromium-linux.png # apps/docs/__tests__/__screenshots__/SidebarNav_.test.jsx/sidebar-category-with-toc-chromium-linux.png # apps/docs/app/routes/LandingPage.res # apps/docs/package.json # apps/docs/plugins/reason-highlightjs.js # apps/docs/src/bindings/Env.res # apps/docs/src/common/ColorTheme.res # apps/docs/src/common/ColorTheme.resi # apps/docs/src/common/Url.res # apps/docs/src/components/DocsonLazy.res # apps/docs/src/components/Search.res # apps/docs/src/layouts/SidebarLayout.res # apps/docs/src/layouts/SidebarLayout.resi # apps/docs/src/markdown/TocUtils.res # apps/docs/styles/_theme.css # apps/docs/vite.config.mjs # apps/docs/vitest.setup.mjs
Persist guide editor code in local storage and show a desktop-only message on narrow viewports, with browser coverage for both states.
Introduce the first guide lesson model, expected-output checkpoint evaluation, and localStorage progress/code storage in the rescript-guide:v1 namespace.
Add a function-call lesson that asks learners to change greet("ReScript") to greet("Spock") and completes the checkpoint when the output is Hello, Spock!.
Route guide lessons through React Router hash navigation so browser Back returns to the previous lesson. Disable playground URL syncing in the guide compiler bridge so compiler state does not overwrite lesson hashes.
Enable the final guide Done action once the checkpoint is complete and route it to the ReScript manual introduction. Cover the completed final lesson state and docs navigation target in guide browser tests.
Cloudflare deploymentDeployement ID: 0496d981-c295-4314-95d4-b36cdc2a6c79 ⛅️ wrangler 4.85.0 ✨ Uploading _redirects |
Move the initial guide lessons into positioned MDX files and load them through the guide route loader. Parse frontmatter and markdown content in ReScript, keeping GuideLesson as the typed UI contract.
|
This is already awesome! |
Cloudflare deploymentDeployement ID: 60dc1f0e-7511-4f05-a043-bb8ec6db689d ⛅️ wrangler 4.85.0 ✨ Uploading _redirects |
Move duplicated guide and playground bindings into shared modules, update guide tests to use MemoryRouter and unsafe test accessors, and replace guide-only helpers with shared ReScript APIs. Also routes DocSearch navigation through useNavigate so the shared React Router binding no longer points at a missing react-router-dom export.
Move guide navigation, layout resizing, editor lifecycle, output rendering, and compiler bridge effects into focused modules. Add brief comments around the storage, hash, editor, and runtime import edge cases.
Break the guide browser tests into focused suites for compiler feedback, compiler settings, lessons, layout persistence, output rendering, and runtime transforms. Add runtime import helper coverage and keep GuideHome tests focused on integrated browser behavior.
Move guide runtime transformation onto the shared Babel bindings already used by playground code. Keep Babel package ownership in the shared workspace so guide code imports the shared API instead of declaring its own bindings.
Add short comments describing why the shared Babel surface stays narrow, why externals are wrapped, and why the generator binding uses Babel's named export.
Return the shared Babel module to direct externals and declare Babel dependencies on workspaces whose generated JavaScript imports them directly.
This is not complete or being deployed anywhere yet, but the shell is there.
ReScript.Guide.and.3.more.pages.-.Work.-.Microsoft.Edge.2026-05-04.15-03-56.mp4
This does not:
Review follow-up notes:
packages/shared.generateexport because that is the callable ESM export.apps/docs/src/components/Search.reschanged as part of that cleanup because the oldReactRouter.navigateexternal pointed at a missingreact-router-dom.navigateexport. DocSearch now usesReactRouter.useNavigate()inside the active search component and passes that navigate function into its navigator.