NO-CODE: Speculative Petrinaut import graph refactor#8705
Draft
NO-CODE: Speculative Petrinaut import graph refactor#8705
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
|
||
| export function shouldApplyReactCompiler(id: string, code: string) { | ||
| return ( | ||
| reactCompilerIdInclude.test(id) && |
| export function shouldApplyReactCompiler(id: string, code: string) { | ||
| return ( | ||
| reactCompilerIdInclude.test(id) && | ||
| !reactCompilerIdExclude.some((pattern) => pattern.test(id)) && |
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 is the purpose of this PR?
This PR makes Petrinaut cheaper to import and rebuild by reshaping the editor's module graph around the heavy optional systems that were previously reached from the editor shell.
Before this branch, mounting Petrinaut pulled too much into one broad graph: inline application workers, language tooling, Monaco setup, graph layout, Babel visualizer compilation, timeline charting, examples, font CSS, and package CSS. That meant small CSS or UI changes could make the dev toolchain revisit unrelated editor internals.
The target state is a more intentional package boundary:
🔗 Related links
.context/petrinaut-characterization/before-vs-final.md.context/petrinaut-characterization/2026-05-05T19-23-54-705Z.md.context/petrinaut-characterization/2026-05-06T09-48-25-169Z.md🚫 Blocked by
None.
🔍 What does this change?
@hashintel/petrinautfrom HASH frontendtranspilePackagesand imports@hashintel/petrinaut/styles.css.Performance report
Measured with
yarn workspace @hashintel/petrinaut profile:build --include-checkson the same machine.@font-facerulesDeveloper experience samples:
Bundle topology signals:
@babel/standalonein mainelkjsin mainuplotin main?worker&inlineimportsPre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
Petrinaut is an npm-publishable library and this changes its package boundary, build topology, and stylesheet export. I did not add a changeset because this branch is primarily a dev/build topology refactor, but reviewers should decide whether the package export and stylesheet contract warrant one.
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
This adds Petrinaut package scripts for bundle profiling and guarding. I did not update Turbo config because these are package-local commands and existing verification used direct workspace commands.
yarn workspace @apps/hash-frontend lint:tscandyarn workspace @apps/hash-frontend buildcurrently fail before reaching the Petrinaut package boundary because generated GraphQL/API artifacts are missing and there are existing Block Protocol type import mismatches. No Petrinaut package-resolution, stylesheet-export, or worker-asset error was reached in those checks.🐾 Next steps
viteFinal/ story graph tuning.tsdownmigration spike separately from this graph-topology refactor.🛡 What tests cover this?
libs/@hashintel/petrinaut/src/provider-lifecycle.test.tsxlibs/@hashintel/petrinaut/src/lsp/worker/use-language-client.test.tslibs/@hashintel/petrinaut/src/simulation/worker/use-simulation-worker.test.tslibs/@hashintel/petrinaut/src/state/mutation-provider.test.tsxlibs/@hashintel/petrinaut/vite.config.test.tslibs/@hashintel/petrinaut/panda.config.shared.test.tslibs/@hashintel/petrinaut/scripts/characterize-build-output.test.mjs❓ How to test this?
Run:
Optional full characterization:
Manual smoke test:
📹 Demo
No visual demo. This PR is primarily build graph, lazy-loading, package boundary, and verification work.