Skip to content

fix: share guide and playground compiler helpers - #1441

Open
fhammerschmidt wants to merge 1 commit into
rescript-lang:masterfrom
fhammerschmidt:fix/1421-playground-shared
Open

fhammerschmidt wants to merge 1 commit into
rescript-lang:masterfrom
fhammerschmidt:fix/1421-playground-shared

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

The guide and playground maintained separate version filters, runtime import collectors and URL mappings, console handlers, and compiler endpoint configuration. Their behavior had diverged, and the playground's digit-concatenation sort could put v12.9.0 ahead of v12.10.0.

  • Compare semantic-version components numerically, including prerelease identifiers, and centralize the playground's supported compiler range. Accept future stable v11 minors above its v11.1.4 minimum.
  • Share Babel namespace-import collection and runtime URL mapping across both execution paths, retaining older compiler compatibility and .mjs to .js CDN mapping.
  • Share iframe console serialization, message decoding, subscriptions, and log text. Handle null logs and ignore malformed or unrelated messages.
  • Move compiler endpoint configuration out of Node bindings. Keep the /try loader safe for Cloudflare runtime SSR, preserve production same-origin bundles and endpoint overrides, and check metadata HTTP failures.
  • Reuse the guide compiler pin and browser-loading behavior from fix: pin the guide compiler and validate lesson output #1439. The guide stays on v12.3.1 and no longer needs versions metadata. fix: pin the guide compiler and validate lesson output #1439 adds build-time lesson validation; merge that PR first. Its validator will use the same console serializer.

Targets website master (v12), on fix/1421-playground-shared. No compiler repository changes.

Validation:

  • Strict ReScript compilation and repository formatting pass.
  • All 81 Node tests pass, including 25 new shared-helper regressions.
  • Guide and documentation production builds pass.
  • A temporary merge with fix: pin the guide compiler and validate lesson output #1439 is conflict-free and passes strict compilation, all 97 Node tests, and the guide production build with lesson validation enabled.
  • All six GitHub Actions jobs pass, including the 25 new Node regressions, guide browser tests, visual regression, Cloudflare Wrangler checks, and homepage end-to-end tests.

Fixes #1407.
Part of #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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T22:34:51.536539Z ccfce52 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

fhammerschmidt added a commit to fhammerschmidt/rescript-lang.org that referenced this pull request Oct 9, 2026
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.
fhammerschmidt added a commit to fhammerschmidt/rescript-lang.org that referenced this pull request Oct 9, 2026
Keep validation failures fatal while allowing the shared compiler loader refactor in rescript-lang#1441 to merge cleanly.

Part of rescript-lang#1421.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated playground logic between guide and playground, two copies diverged

1 participant