Repository navigation
fix: share guide and playground compiler helpers - #1441
Open
fhammerschmidt wants to merge 14 commits into
Open
fhammerschmidt wants to merge 14 commits into
fhammerschmidt wants to merge 14 commits into
Conversation
Pin browser compilation and lesson validation to ReScript v12.3.1. Compile each starter and reference solution during prerendering, then compare its runtime output with the checkpoint using the shared guide transformations. Keep reference solutions out of published lesson data, fail builds on compiler CDN errors, and show stalled browser compiler loading with a reload message. Add real compiler validation and browser failure coverage. Fixes rescript-lang#1405. Part of rescript-lang#1421.
Centralize version comparison, runtime import collection and mapping, console messages, and compiler endpoint configuration. Sort numeric version components correctly and preserve the guide compiler pin from rescript-lang#1439. Add regression coverage for both runtime transforms, iframe serialization, metadata failures, endpoint overrides, and multi-digit compiler versions. Fixes rescript-lang#1407. Part of rescript-lang#1421.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Use common compiler endpoint configuration and console serialization so the guide compiler pin and lesson validator stay compatible with the playground refactor in rescript-lang#1441. Keep this PR independently buildable before rescript-lang#1441 is merged. Fixes rescript-lang#1405. Part of rescript-lang#1421.
Keep validation failures fatal while allowing the shared compiler loader refactor in rescript-lang#1441 to merge cleanly. Part of rescript-lang#1421.
Port all lesson compiler coverage to typed ReScript tests and update Vitest discovery. Resolve master conflicts while retaining build/client assets, compiler validation, and browser history test commands.
Add build-only expectedInitialDiagnostic metadata for syntax and type errors. Require every diagnostic message to match and an explicit solution that still compiles, runs, and produces the checkpoint output. Cover authoring errors and compiler failures, document the mode, and align browser fixtures with the pinned compiler.
Drive loading failures through the shared CDN mock installed by the guide test setup. Remove the obsolete DOM script interception, which cannot see requests handled by that mock, while retaining timeout coverage.
Bring in the latest master and rescript-lang#1439 changes, including expected starter diagnostics, before converting the shared compiler tests to ReScript.
Move all 25 shared compiler cases into the guide compiler suite, where they can use the guide and shared modules directly. Preserve version, import, console bridge, and metadata coverage using typed Vitest and Node VM bindings, and remove the JavaScript-only docs test glob.
Keep the validated lesson schema from rescript-lang#1438 alongside pinned compiler validation and expected starter diagnostics. Run both Node test suites before browser tests, and document the combined authoring contract.
Bring in the resolved rescript-lang#1439 branch and the merged rescript-lang#1438 authoring contract. Preserve the ReScript shared compiler suite and run both lesson and compiler checks in guide CI.
Keep the pinned compiler and intentional starter diagnostics while incorporating the merged cleanup. Remove the unused NODE_ENV binding so the new dead-code check passes.
Merge the resolved guide compiler branch and keep shared version sorting after the obsolete scroll-lock code was removed. Retain NODE_ENV for the shared endpoint loader and remove the now-unused Babel specifier helper so dead-code checks pass.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Share compiler version filtering and sorting between the guide and playground. Compare version components numerically, including prerelease identifiers, so versions such as v12.10.0 sort correctly. Keep the playground's supported compiler range in one place.
Share Babel import collection and runtime URL mapping across both execution paths. Preserve compatibility with older compilers and the CDN's
.mjsto.jsmapping.Share iframe console serialization, message decoding, subscriptions and log text. Handle
nullvalues and ignore malformed or unrelated messages.Move compiler endpoint configuration out of Node bindings so the
/tryloader can run on Cloudflare. Preserve same-origin production bundles and endpoint overrides, and report failed metadata requests.Use the pinned guide compiler and loading behavior from #1439, including the shared console serializer used by lesson validation.
Write the shared compiler regression tests in ReScript under
apps/guide/__tests__/compiler/PlaygroundShared_.test.res, using the actual shared and guide modules directly. Run these 25 cases through the existing guide compiler test command.Validation: strict ReScript compilation, formatting checks, and the production guide build pass. CI passes all 52 lesson-contract tests, all 61 compiler tests (25 converted shared-helper cases and 36 lesson-validation tests), all 50 guide browser tests, and the browser-history E2E test.
Merge after #1439.
Part of #1421.
Fixes #1407