Closed
Conversation
📊 Bundle size reportUnchanged fixtures
|
2f57972 to
1eab167
Compare
dfbe546 to
1a4de81
Compare
This was referenced Jan 10, 2023
layershifter
commented
Jan 11, 2023
Comment on lines
+25
to
+26
| "@griffel/linaria-processor/make-styles": ["packages/linaria-processor/src/MakeStylesProcessor.ts"], | ||
| "@griffel/linaria-processor/make-reset-styles": ["packages/linaria-processor/src/MakeResetStylesProcessor.ts"], |
Member
Author
There was a problem hiding this comment.
Aliases that match export maps in @griffel/linaria-processor, needed for Jest.
1a4de81 to
90a6c0e
Compare
layershifter
commented
Jan 11, 2023
Comment on lines
-1
to
-2
| const react_make_styles_1 = require('@griffel/react'); | ||
| export const useStyles = react_make_styles_1.__styles( |
Member
Author
There was a problem hiding this comment.
require() and export 🙈
90a6c0e to
c2600b3
Compare
layershifter
commented
Jan 11, 2023
| "ajv": "^8.4.0", | ||
| "browserslist": "^4.19.1", | ||
| "csstype": "^3.0.10", | ||
| "enhanced-resolve": "^5.8.2", |
Member
Author
There was a problem hiding this comment.
We don't need to handle resolutions on our end anymore 💅
layershifter
commented
Jan 11, 2023
| pluginOptions: { | ||
| babelOptions: { | ||
| presets: ['@babel/typescript'], | ||
| sourceType: 'unambiguous', |
Member
Author
There was a problem hiding this comment.
This will be probably defined in Linaria itself. Forces Babel to detect a type of module, so it will emit import/require properly.
layershifter
commented
Jan 11, 2023
layershifter
commented
Jan 11, 2023
| plugins: [[transformPlugin, options]], | ||
| }; | ||
| export default function griffelPreset(babel: ConfigAPI, options: BabelPluginOptions = {}) { | ||
| const { babelOptions, evaluationRules } = validateOptions(options); |
Member
Author
There was a problem hiding this comment.
I decided to not expose all Linaria options to better control APIs.
99f2719 to
b5a58c8
Compare
a19e9e5 to
b5ccbfa
Compare
b5ccbfa to
a998d86
Compare
ea91f83 to
8d36747
Compare
Merged
2384cac to
e737178
Compare
e9aa068 to
d610051
Compare
ea632ac to
cfd2873
Compare
8 tasks
cd4c944 to
7758dcf
Compare
fc77183 to
aad3473
Compare
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
This PR upgrades
@griffel/babel-presetand@griffel/webpack-loaderto use Linaria v4. Linaria v4 introduced 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.jsonfiles:{ "linaria": { "tags": { "makeStyles": "@griffel/linaria-processor/make-styles", "makeResetStyles": "@griffel/linaria-processor/make-reset-styles" } } }👆 indicates Linaria to process
makeStyles&makeResetStyleswith matching transformsAnother benefit is that Linaria v4 supports async resolving of dependencies that was a blocker for other bundlers (#33).
BREAKING CHANGES
@griffel/babel-presetmodules&projectRootoptions removed from configs, usepackage.jsonto define processors (see Summary ⬆️ )EvalCache&Moduleare not longer exported and should not be used directly anymore@griffel/linaria-processorinstalled@griffel/webpack-loadermodules&projectRootoptions removed from configs, usepackage.jsonto define processors (see Summary ⬆️ )@griffel/linaria-processorinstalledDetails
@griffel/babel-presetAll internals of
@griffel/babel-presetwere 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.jsonfilesimport-custom-name: aliases are configured now inpackage.jsonfilesnon-existing-module-call: removed,@linaria/shakernow 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-loaderAll internals of
@griffel/webpack-loaderwere removed, now it's just a tiny wrapper around@linaria/webpack-loader.Following fixtures were removed:
config-modules: aliases are configured now inpackage.jsonfileserror-argument-count: not needed, check is not longer thereerror-syntax: not neededNew fixture
react-componentto test a more real life example.Related issues
Fixes #104.
Fixes #184.
Fixes #313.
TODOs
🔴 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