Commit 4e637d6
feat: switch from @linaria/shaker to @griffel/transform-shaker (#795)
* feat(transform): replace @linaria/shaker with @griffel/transform-shaker
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>
* refactor: remove StrictOptions, babelOptions, and simplify Evaluator 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>
* Change files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: revert snapshot changes, rename _shakerEvaluator
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent d5bcd3b commit 4e637d6
24 files changed
Lines changed: 79 additions & 167 deletions
File tree
- change
- packages
- transform-shaker
- src
- transform
- __fixtures__/config-babel-options
- src
- evaluation
- webpack-plugin/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 20 | + | |
38 | 21 | | |
39 | 22 | | |
40 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 62 | | |
70 | 63 | | |
71 | 64 | | |
72 | 65 | | |
73 | 66 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
81 | 72 | | |
82 | 73 | | |
83 | 74 | | |
| |||
Whitespace-only changes.
Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 0 additions & 4 deletions
This file was deleted.
0 commit comments