feat: switch from @linaria/shaker to @griffel/transform-shaker#795
Merged
layershifter merged 4 commits intomainfrom Mar 10, 2026
Merged
feat: switch from @linaria/shaker to @griffel/transform-shaker#795layershifter merged 4 commits intomainfrom
layershifter merged 4 commits intomainfrom
Conversation
📊 Bundle size report✅ No changes found |
10a0a54 to
0f76fb8
Compare
Replace the external @linaria/shaker dependency with the internal @griffel/transform-shaker package. Since the new shaker produces ESM output (vs Babel-compiled CJS from the old shaker), add an ESM→CJS converter in Module.evaluate so code can run inside vm.Script's function wrapper. Also fix several shaker graph-builder bugs uncovered during integration: - ImportDeclaration not kept alive when its bindings are referenced - ExportNamedDeclaration declarators removed from shaken output - Missing TemplateLiteral:expressions and SpreadElement:argument handlers - Computed Property:key not treated as a variable reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…signature
- Remove StrictOptions type (was just { rules: EvalRule[] })
- Remove babelOptions from TransformOptions and all call sites
- Simplify Evaluator to (filename, text, only) => [string, Map | null]
- Module class now takes rules: EvalRule[] directly
- Remove config-babel-options fixture and test
- Remove private: true from transform-shaker
- Add @griffel/transform-shaker dependency, remove oxc-transform
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0f76fb8 to
d7b50fd
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
YuanboXue-Amber
approved these changes
Mar 10, 2026
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
Replaces the external
@linaria/shakerdependency with the internal@griffel/transform-shakerpackage for tree-shaking during build-time evaluation.Breaking changes
babelOptionsremoved fromTransformOptionsandWebpackLoaderOptions— Babel is no longer used for code transformation;oxc-transformhandles TypeScript/JSX stripping in@griffel/transform-shakerdirectlyStrictOptionstype removed — replaced byEvalRule[]directlyEvaluatorsignature simplified — from(filename, options, text, only)to(filename, text, only)@griffel/transform-shakerpublished as a new public package (initial release)oxc-transformremoved from@griffel/transformdependencies (moved to@griffel/transform-shaker)Changes
packages/transform-shaker/package.json— removeprivate: truepackages/transform/package.json— add@griffel/transform-shakerdep, removeoxc-transformpackages/transform/src/evaluation/types.mts— removeStrictOptions, simplifyEvaluatortypepackages/transform/src/evaluation/module.mts— takerules: EvalRule[]directly instead ofStrictOptionspackages/transform/src/evaluation/vmEvaluator.mts— removebabelOptionsparampackages/transform/src/evaluation/batchEvaluator.mts— removebabelOptionsparampackages/transform/src/evaluation/hybridEvaluator.mts— update evaluator call sitespackages/transform/src/transformSync.mts— removebabelOptionsfromTransformOptions, remove typecastpackages/webpack-plugin/src/webpackLoader.mts— removebabelOptionsfrom loader optionsconfig-babel-optionsfixture (no longer applicable)packages/transform-shaker/src/— simplifyEvaluatortype and remove dead optionsTest plan
nx test transform-shaker— 34 tests passnx test transform— 65 tests pass🤖 Generated with Claude Code