chore: migrate to to wyw-in-js #414
Draft
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.
TODO
Update PR to reflect removal of
@griffel/babel-preset
.Summary
This PR upgrades
@griffel/babel-preset
and@griffel/webpack-loader
to use wyw-in-js. wyw-in-js introduces a concept of processors to handle different CSS-in-JS implementations i.e. "implement your processor (transform) and use existing tooling to run it".The information is obtainer from
package.json
files:👆 indicates Linaria to process
makeStyles
&makeResetStyles
with matching transformsAnother benefit is that Linaria v5 supports async resolving of dependencies that was a blocker for other bundlers (#33).
BREAKING CHANGES
@griffel/babel-preset
modules
&projectRoot
options removed from configs, usepackage.json
to define processors (see Summary ⬆️ )EvalCache
&Module
are not longer exported and should not be used directly anymore@griffel/linaria-processor
installedTODO
@griffel/webpack-loader
modules
&projectRoot
options removed from configs, usepackage.json
to define processors (see Summary ⬆️ )@griffel/linaria-processor
installedDetails
@griffel/babel-preset
All internals of
@griffel/babel-preset
were removed: module evaluation is gone, parts related to assets handling were moved to@griffel/linaria-processor
.error-argument-count
: not needed, check is not longer thereimport-custom-module
: aliases are configured now inpackage.json
filesimport-custom-name
: aliases are configured now inpackage.json
filesnon-existing-module-call
: removed,@linaria/shaker
now works differentlyrequire-custom-module
: removed, not neededUpdated fixtures:
asset
: file paths handled properly, fixes babel-preset: handles relative paths as assets #313config-evaluation-rules
: we don't have own evaluation part anymore, matches to what Linaria doesduplicated-imports
: handles multiple imports as it should be 💪 Fixes babel-preset: multiple modules produce the same import #104@griffel/webpack-loader
All internals of
@griffel/webpack-loader
were removed, now it's just a tiny wrapper around@linaria/webpack-loader
.Following fixtures were removed:
config-modules
: aliases are configured now inpackage.json
fileserror-argument-count
: not needed, check is not longer thereerror-syntax
: not neededNew fixture
react-component
to test a more real life example.TODO
Related issues
Fixes #104.
Fixes #184.
Fixes #313.
TODOs
Pass proper import sources in processors🔴 "export *" prevent shaking and removal of unused code callstack/linaria#1311🔴 BLOCKER Tags parsing is too aggressive callstack/linaria#1214🔴 BLOCKER EvalError: tslib_1.__importStar is not a function callstack/linaria#1209🔴 BLOCKER: TS helpers for imports are not fully handled? callstack/linaria#1186🔴 BLOCKER: feat(tags): introduce tagSource for processors callstack/linaria#1188🔴 BLOCKER: import side-effects are removed callstack/linaria#1189💣 BLOCKER: Circulars dependencies are causing infinite loop callstack/linaria#1193