Repository navigation
Put the playground online and let it explain what Maple is - #19
Merged
Merged
Conversation
The Context pane becomes the Host context: a JavaScript module the worker imports from a blob URL. INSTANCE_DATA becomes the instance's globals and RUN_DATA the data of each run, so scripts can call host functions.
A first visit opens a dialog on what Maple is and how to read the playground. An Examples menu loads scripts that show what Maple is for and how it keeps scripts in, and the header links to GitHub and npm and shows the library's version.
The pages job publishes the playground to https://netwin.github.io/maple/ after each release run on master, and the READMEs link to it.
📋 Release PreviewChangelog0.5.1 (2026-10-24)📖 Documentation
🛠️ Code Refactoring
🔄️ Continuous Integration
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical release/configuration issues and moderate host-module, benchmark, and mobile-layout issues remain.
6 open issues
JSON import fails without resolveJsonModule configuration · New Playground breaking commits can still trigger library releases · New Header CTA overflows on small screens · New Benchmark drops the host module error prefix · New Explicitly undefined exports are incorrectly accepted · New README incorrectly describes the published playground as private · New
What changed in this PR
This pull request turns the Maple playground into a public, self-explanatory browser demo with editable host modules, examples, benchmarking, and GitHub Pages deployment.
Changes:
- Adds a welcome dialog, examples menu, responsive navigation, project links, and version display.
- Replaces JSON context input with JavaScript host modules supporting instance data, run data, and host functions.
- Updates workers, runners, benchmarking, persistence, and documentation for the host-module model.
- Configures playground-only release handling and GitHub Pages deployment from
master.
| File | Description |
|---|---|
release.config.js |
Adds playground-specific release suppression and hidden changelog rules. |
README.md |
Links to the hosted playground. |
packages/maple/README.md |
Links to the hosted playground from the library documentation. |
apps/maple-playground/src/app/ui/welcome-dialog.ts |
Implements welcome dialog behavior. |
apps/maple-playground/src/app/ui/welcome-dialog.html |
Adds explanatory Maple introduction content. |
apps/maple-playground/src/app/ui/settings-menu.html |
Makes settings controls responsive. |
apps/maple-playground/src/app/ui/examples-menu.ts |
Implements example selection behavior. |
apps/maple-playground/src/app/ui/examples-menu.html |
Adds the Examples popover menu. |
apps/maple-playground/src/app/ui/benchmark-panel.html |
Updates benchmark terminology for host context. |
apps/maple-playground/src/app/data-access/runner.ts |
Runs scripts using generated host-module URLs. |
apps/maple-playground/src/app/data-access/project.ts |
Provides package version and project links. |
apps/maple-playground/src/app/data-access/playground.ts |
Persists host context, examples, and welcome state. |
apps/maple-playground/src/app/data-access/maple.worker.ts |
Imports host modules and reuses Maple instances. |
apps/maple-playground/src/app/data-access/maple-worker-protocol.ts |
Updates the worker protocol for host-module URLs. |
apps/maple-playground/src/app/data-access/js-interpreter-engine.ts |
Updates benchmark documentation for host data. |
apps/maple-playground/src/app/data-access/host-module.ts |
Creates, imports, and validates host-context modules. |
apps/maple-playground/src/app/data-access/examples.ts |
Defines the eight educational examples. |
apps/maple-playground/src/app/data-access/benchmark.worker.ts |
Benchmarks host modules in Maple and js-interpreter. |
apps/maple-playground/src/app/data-access/benchmark.ts |
Manages benchmark host-module URLs. |
apps/maple-playground/src/app/data-access/benchmark-protocol.ts |
Updates benchmark request handling for host modules. |
apps/maple-playground/src/app/app.ts |
Integrates examples, onboarding, host context, and execution. |
apps/maple-playground/src/app/app.html |
Adds the new header, panes, links, and welcome dialog. |
apps/maple-playground/README.md |
Documents the public playground, host modules, examples, and deployment. |
apps/maple-playground/angular.json |
Configures the development server. |
.github/workflows/push.yml |
Builds and deploys the playground to GitHub Pages. |
Review effort: Lite
Merged
|
🎉 This PR is included in version 0.5.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.



What changes
The playground becomes something you can hand to someone who has never heard of Maple:
masterafter each release run. The rootand library READMEs link to it.
interpret, isolate), what a script can't do, how to read the panes, and how to install it. The header button
reopens it.
host function, a data transformation) to how it keeps scripts in (no host globals, a blocked prototype escape, no
eval, a runaway loop stopped at the operation limit, instance vs. run data, errors like JavaScript). The pricingrule replaces the old "Hello, name" greeting as the default.
INSTANCE_DATAexport becomes the instance'sglobalsandRUN_DATAthe data of each run, so scripts can callhost functions. The panes are named after the trust boundary: Host context, Script (sandboxed),
Output.
Nothing changes for hosts or scripts using the library: no library code, docs or divergences are touched.
Commits scoped to
playgroundno longer release@netwin/mapleand stay out of its release notes, so theplayground can use honest
featandfixcommits.How
release.config.jsgets{ scope: 'playground', release: false }in the commit analyzer'srules, and a hidden twin of every release notes type scoped to
playground. The preset uses the first type entrythat matches, so the hidden ones go first.
worker imports it once per URL and keeps one
Mapleper module and limits, so state the module keeps (a counterin a host function) lasts until the next edit, as it would in a long-lived host.
host-module.tschecks theexports: both optional, anything else (or a module that fails to load) shows as Host module failed, apart
from Maple's own errors. The Benchmark imports its own URL; js-interpreter gets
{ ...INSTANCE_DATA, ...RUN_DATA }.on load. Invisible before, but with stateful host functions it showed. A
runInputcomputed with an equalitycheck now drops unchanged input.
<dialog>, animated with@starting-styleandtransition-behavior: allow-discreteonly (no motion with
prefers-reduced-motion). The content scrolls inside the dialog, so the rounded corners clipthe scrollbar; the close button at the top takes the focus, so opening never scrolls to the bottom (iOS Safari).
packages/maple/package.json; only the string ends up in thebundle. Below
sm, the header buttons show icons only.pagesjob inpush.ymlruns afterreleaseand checks out the tip ofmaster, so the versionthe playground shows includes a release commit just pushed. It builds with
--base-href /maple/and deploys withupload-pages-artifactanddeploy-pages. Pages is enabled with GitHub Actions as its source, and thegithub-pagesenvironment allows deployments frommasteronly.Tests, parity and docs
pnpm format,lint,typecheck,testandbuildpass. Every example was run through Maple in Node, and the error messages of"Errors like JavaScript" match Node's. In Chrome: host module errors, read-only instance data, shadowing, state
across runs, the Benchmark with host functions, all examples, the dialog in both themes and at phone width. A
production build served under
/maple/loads Monaco, fonts and both workers. The release rules were dry-run withthe real commit analyzer and notes generator.
CONTRIBUTING.mdmentions that
playgroundcommits don't release. Thepagesjob itself only runs onmaster, so its first runafter the release is its real test.