Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/bump-wyw-1-0-x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@linaria/atomic': major
'@linaria/babel-plugin-interop': major
'@linaria/core': major
'@linaria/postcss-linaria': major
'@linaria/react': major
'@linaria/server': major
'@linaria/stylelint': major
'@linaria/stylelint-config-standard-linaria': major
'@linaria/testkit': major
linaria: major
---

BREAKING: bump `@wyw-in-js/*` dependencies to `^1.0.0` (stable).

This release updates Linaria's build-time evaluation engine (WyW). See https://wyw-in-js.dev/stability for practical guidance and common pitfalls.

Notes:

- If you import JSON from code that is evaluated by WyW, add `.json` to `extensions` and ensure `.json` is ignored by evaluation rules (so it's parsed as JSON, not by Babel).
- Rollup users: WyW 1.x serializes `transform()` by default (`serializeTransform: true`). If you hit Rollup "Unexpected early exit" (unresolved plugin promises / deadlock during resolve), set `serializeTransform: false` (see `examples/rollup/rollup.config.mjs`).
- WyW 1.x promotes fully-statically-evaluatable modules to `only: ['*']` and can re-evaluate modules when cached exports are incomplete (cached export values might not be reused).
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ Linaria is now built on top of [wyw-in-js.dev](https://wyw-in-js.dev/). It suppo

See [Configuration](https://wyw-in-js.dev/configuration) to customize how Linaria processes your files.

## Stability

Linaria relies on WyW (`@wyw-in-js/*`) to evaluate your modules at build time and extract CSS. If you hit issues like slow builds, invalidation storms, or unexpected code being executed during the build, it’s usually related to the WyW evaluation model and how your modules are structured.

See https://wyw-in-js.dev/stability for practical guidance and common pitfalls.

## Syntax

Linaria can be used with any framework, with additional helpers for React. The basic syntax looks like this:
Expand Down
11 changes: 11 additions & 0 deletions docs/MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Migration Guide

# 7.x from 6.x

## For Users

Linaria 7 updates the WyW toolchain (`@wyw-in-js/*`) to `^1.0.0` (stable). This affects build-time evaluation (CSS extraction) and can surface previously hidden issues in evaluated modules.

- Review https://wyw-in-js.dev/stability for the evaluation model, common pitfalls, and performance guidance.
- If you rely on WyW cache internals, note that WyW 1.x can promote fully-statically-evaluatable modules to `only: ['*']` and may re-evaluate modules when cached exports are incomplete.
- If you import JSON from code that is evaluated by WyW, add `.json` to `extensions` and ensure `.json` is ignored by evaluation rules (so it's parsed as JSON, not by Babel).
- Rollup users on WyW 1.0.6: WyW serializes `transform()` by default; if you hit Rollup "Unexpected early exit" (unresolved plugin promises), try `serializeTransform: false` in the WyW Rollup plugin config.

# 6.x from 5.x, 4.x, 3.x

## For Users
Expand Down
2 changes: 1 addition & 1 deletion examples/astro-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@astrojs/solid-js": "^1.2.3",
"@babel/core": "^7.23.5",
"@linaria/core": "workspace:^",
"@wyw-in-js/vite": "^0.6.0",
"@wyw-in-js/vite": "^1.0.6",
"astro": "^1.6.10",
"solid-js": "^1.6.2",
"vite": "^3",
Expand Down
2 changes: 1 addition & 1 deletion examples/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"linaria-website": "workspace:^"
},
"devDependencies": {
"@wyw-in-js/esbuild": "^0.6.0",
"@wyw-in-js/esbuild": "^1.0.6",
"esbuild": "^0.15.16"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions examples/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-image": "^3.0.2",
"@rollup/plugin-node-resolve": "^15.2.1",
"@wyw-in-js/rollup": "^0.6.0",
"rollup": "^3.29.5",
"@wyw-in-js/rollup": "^1.0.6",
"rollup": "^4.0.0",
"rollup-plugin-css-only": "^4.3.0"
},
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions examples/rollup/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export default {
image(),
wyw({
sourceMap: process.env.NODE_ENV !== 'production',
// Rollup can deadlock when WyW resolves imports during transform.
serializeTransform: false,
}),
css({
output: 'styles.css',
Expand Down
2 changes: 1 addition & 1 deletion examples/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.2.1",
"@vitejs/plugin-react": "^2.1.0",
"@wyw-in-js/vite": "^0.6.0",
"@wyw-in-js/vite": "^1.0.6",
"vite": "^3.2.10"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/vpssr-linaria-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "ISC",
"dependencies": {
"@linaria/core": "workspace:^",
"@wyw-in-js/vite": "^0.6.0",
"@wyw-in-js/vite": "^1.0.6",
"babel-preset-solid": "^1.6.2",
"compression": "^1.7.4",
"express": "^4.20.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"devDependencies": {
"@babel/core": "^7.23.5",
"@wyw-in-js/webpack-loader": "^0.6.0",
"@wyw-in-js/webpack-loader": "^1.0.6",
"babel-loader": "^9.1.0",
"cross-env": "^7.0.3",
"css-hot-loader": "^1.4.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/atomic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"dependencies": {
"@linaria/core": "workspace:^",
"@linaria/react": "workspace:^",
"@wyw-in-js/processor-utils": "^0.6.0",
"@wyw-in-js/shared": "^0.6.0",
"@wyw-in-js/processor-utils": "^1.0.4",
"@wyw-in-js/shared": "^1.0.4",
"known-css-properties": "^0.24.0",
"postcss": "^8.4.31",
"stylis": "^4.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"watch": "pnpm build:dist --watch & pnpm build:declarations --watch"
},
"dependencies": {
"@wyw-in-js/processor-utils": "^0.6.0"
"@wyw-in-js/processor-utils": "^1.0.4"
},
"devDependencies": {
"@babel/traverse": "^7.23.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"dependencies": {
"@emotion/is-prop-valid": "^1.2.0",
"@linaria/core": "workspace:^",
"@wyw-in-js/processor-utils": "^0.6.0",
"@wyw-in-js/shared": "^0.6.0",
"@wyw-in-js/processor-utils": "^1.0.4",
"@wyw-in-js/shared": "^1.0.4",
"minimatch": "^9.0.3",
"react-html-attributes": "^1.4.6",
"resolve": "^1.22.8",
Expand Down
4 changes: 2 additions & 2 deletions packages/stylelint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"watch": "pnpm build:lib --watch & pnpm build:esm --watch & pnpm build:declarations --watch"
},
"dependencies": {
"@wyw-in-js/shared": "^0.6.0",
"@wyw-in-js/transform": "^0.6.0"
"@wyw-in-js/shared": "^1.0.4",
"@wyw-in-js/transform": "^1.0.6"
},
"devDependencies": {
"@types/node": "^17.0.39"
Expand Down
6 changes: 3 additions & 3 deletions packages/testkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"@babel/traverse": "^7.23.5",
"@linaria/react": "workspace:^",
"@swc/core": "^1.3.20",
"@wyw-in-js/processor-utils": "^0.6.0",
"@wyw-in-js/shared": "^0.6.0",
"@wyw-in-js/transform": "^0.6.0",
"@wyw-in-js/processor-utils": "^1.0.4",
"@wyw-in-js/shared": "^1.0.4",
"@wyw-in-js/transform": "^1.0.6",
"debug": "^4.3.4",
"dedent": "^1.5.1",
"esbuild": "^0.15.16",
Expand Down
3 changes: 3 additions & 0 deletions packages/testkit/src/__fixtures__/foo-nonstatic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const foo1 = String('foo1');
export const foo2 = String('foo2');
export const foo3 = () => 'foo3';
Loading