feat(parcel): add Parcel transformer plugin - #1995
Draft
JoshKappler wants to merge 5 commits into
Draft
Conversation
Contributor
size-limit report 📦
|
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
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.
Summary
Testing
Notes
Greptile Summary
This PR introduces
@generaltranslation/parcel-transformer, a new Parcel 2 plugin that runs the General Translation compiler at build time. Since Parcel is not covered by unplugin, the package wraps the same@generaltranslation/compilercore used by the Vite, webpack, and Rollup adapters._hashvalues into<T>elements andt()calls — matching the behavior of the other bundler adapters exactly.GT_SIGNAL_RE) skips the Babel lowering pass for files with no GT usage. The<T[\\s>\\/]boundary (addressed in prior review) correctly avoids false positives for<Typography>,<Table>, etc.gt.config.jsonis loaded viaconfig.getConfigso Parcel registers it as a dependency and invalidates transformed assets on change; the resolved plugin is memoized per options signature to avoid redundant disk reads across files.Confidence Score: 5/5
Safe to merge — this is a self-contained new package with no changes to existing code paths.
The transformer is a new, isolated package. The two-pass Babel+GT flow is well-guarded: the pre-gate regex skips inert files cheaply, Babel failures are caught and passed through, and the GT compiler returning null correctly leaves the original source untouched for Parcel's default pipeline. The prior false-positive concern about the
<Tregex boundary has been fixed and is covered by tests.Files Needing Attention: No files require special attention.
Important Files Changed
Reviews (3): Last reviewed commit: "chore: trim comments to the 3-line house..." | Re-trigger Greptile