Skip to content

[Preview NG] Export preview system hooks from @khanacademy/perseus-editor#3499

Open
jeremywiebe wants to merge 1 commit intojer/preview-ng-5-hooksfrom
jer/preview-ng-6-exports
Open

[Preview NG] Export preview system hooks from @khanacademy/perseus-editor#3499
jeremywiebe wants to merge 1 commit intojer/preview-ng-5-hooksfrom
jer/preview-ng-6-exports

Conversation

@jeremywiebe
Copy link
Copy Markdown
Collaborator

@jeremywiebe jeremywiebe commented Apr 15, 2026

Summary:

This PR is part of a series building a typed, hook-based preview system for the Perseus editor. The new system replaces the untyped window.iframeDataStore + raw postMessage(string) communication with structured, validated message passing via usePreviewController and usePreviewPresenter hooks. The new system is being built alongside the old one — no existing behavior changes until the final PR in the series flips the switch.

Previous PRs in this series:


Exports usePreviewController and usePreviewPresenter from the @khanacademy/perseus-editor package so they can be consumed by the frontend repo and other consumers. This is a small wiring PR — it adds four lines to the package's main index.ts.

Purely additive — no existing behavior is changed.

Issue: LEMS-3741

Test plan:

pnpm tsc and pnpm knip both pass. No new tests needed — the hooks are already fully tested in #3495.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (e604cc6) and published it to npm. You
can install it using the tag PR3499.

Example:

pnpm add @khanacademy/perseus@PR3499

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3499

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3499

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

Size Change: +1.24 kB (+0.25%)

Total Size: 500 kB

📦 View Changed
Filename Size Change
packages/perseus-editor/dist/es/index.js 104 kB +1.24 kB (+1.21%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.5 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.36 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 11.9 kB
packages/perseus-core/dist/es/index.js 25.1 kB
packages/perseus-linter/dist/es/index.js 9.3 kB
packages/perseus-score/dist/es/index.js 9.7 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 196 kB
packages/perseus/dist/es/strings.js 8.27 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

🛠️ Item Splitting: No Changes ✅

@jeremywiebe jeremywiebe marked this pull request as ready for review April 15, 2026 22:05
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@jeremywiebe jeremywiebe force-pushed the jer/preview-ng-5-hooks branch from feb3f11 to 9b6a03d Compare April 16, 2026 22:57
@jeremywiebe jeremywiebe force-pushed the jer/preview-ng-6-exports branch from 8322a21 to e604cc6 Compare April 16, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants