@lynx-js/react-webpack-plugin-canary 0.6.13 → 0.6.14-canary-20250522-fdab5dc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -12
- package/lib/ReactWebpackPlugin.d.ts +1 -15
- package/lib/index.d.ts +2 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.6.14-canary-20250522062909-fdab5dc9d624de0b39957695599cc8eebab90973
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Support `@lynx-js/template-webpack-plugin` v0.7.0. ([#880](https://github.com/lynx-family/lynx-stack/pull/880))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`7beb35e`](https://github.com/lynx-family/lynx-stack/commit/7beb35ebf72f9475c0a200c93c6b9bdaa7980e1b), [`26b75df`](https://github.com/lynx-family/lynx-stack/commit/26b75df8ccc1a2a6d519a12b857bbf6494ef1313), [`d3967c0`](https://github.com/lynx-family/lynx-stack/commit/d3967c037da4f4b57980e4938095329a6045bfa7), [`d3967c0`](https://github.com/lynx-family/lynx-stack/commit/d3967c037da4f4b57980e4938095329a6045bfa7), [`fdab5dc`](https://github.com/lynx-family/lynx-stack/commit/fdab5dc9d624de0b39957695599cc8eebab90973)]:
|
|
10
|
+
- @lynx-js/template-webpack-plugin@0.7.0-canary-20250522062909-fdab5dc9d624de0b39957695599cc8eebab90973
|
|
11
|
+
- @lynx-js/react@0.108.2-canary-20250522062909-fdab5dc9d624de0b39957695599cc8eebab90973
|
|
12
|
+
|
|
3
13
|
## 0.6.13
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -52,7 +62,7 @@
|
|
|
52
62
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
53
63
|
|
|
54
64
|
```js
|
|
55
|
-
import { forwardRef, useImperativeHandle } from
|
|
65
|
+
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
56
66
|
|
|
57
67
|
export default forwardRef(function App(_, ref) {
|
|
58
68
|
useImperativeHandle(ref, () => {
|
|
@@ -60,7 +70,7 @@
|
|
|
60
70
|
return {
|
|
61
71
|
name() {
|
|
62
72
|
// This should be considered as background only
|
|
63
|
-
console.info(
|
|
73
|
+
console.info("This should not exist in main-thread");
|
|
64
74
|
},
|
|
65
75
|
};
|
|
66
76
|
});
|
|
@@ -120,14 +130,14 @@
|
|
|
120
130
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
121
131
|
|
|
122
132
|
```js
|
|
123
|
-
import { pluginReactLynx } from
|
|
124
|
-
import { defineConfig } from
|
|
133
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
134
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
125
135
|
|
|
126
136
|
export default defineConfig({
|
|
127
137
|
plugins: [
|
|
128
138
|
pluginReactLynx({
|
|
129
139
|
defineDCE: {
|
|
130
|
-
__SOME_FALSE_DEFINE__:
|
|
140
|
+
__SOME_FALSE_DEFINE__: "false",
|
|
131
141
|
},
|
|
132
142
|
}),
|
|
133
143
|
],
|
|
@@ -139,20 +149,20 @@
|
|
|
139
149
|
For example, `import` initialized by dead code will be removed:
|
|
140
150
|
|
|
141
151
|
```js
|
|
142
|
-
import { foo } from
|
|
152
|
+
import { foo } from "bar";
|
|
143
153
|
|
|
144
154
|
if (__SOME_FALSE_DEFINE__) {
|
|
145
155
|
foo();
|
|
146
|
-
console.log(
|
|
156
|
+
console.log("dead code");
|
|
147
157
|
} else {
|
|
148
|
-
console.log(
|
|
158
|
+
console.log("reachable code");
|
|
149
159
|
}
|
|
150
160
|
```
|
|
151
161
|
|
|
152
162
|
will be transformed to:
|
|
153
163
|
|
|
154
164
|
```js
|
|
155
|
-
console.log(
|
|
165
|
+
console.log("reachable code");
|
|
156
166
|
```
|
|
157
167
|
|
|
158
168
|
## 0.6.0
|
|
@@ -162,14 +172,14 @@
|
|
|
162
172
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
163
173
|
|
|
164
174
|
```js
|
|
165
|
-
import { pluginReactLynx } from
|
|
166
|
-
import { defineConfig } from
|
|
175
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
176
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
167
177
|
|
|
168
178
|
export default defineConfig({
|
|
169
179
|
plugins: [
|
|
170
180
|
pluginReactLynx({
|
|
171
181
|
compat: {
|
|
172
|
-
removeComponentAttrRegex:
|
|
182
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
173
183
|
},
|
|
174
184
|
}),
|
|
175
185
|
],
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import type { Compiler } from '@rspack/core';
|
|
2
|
+
import type { ExtractStrConfig } from '@lynx-js/react/transform';
|
|
2
3
|
import { LAYERS } from './layer.js';
|
|
3
|
-
/**
|
|
4
|
-
* The options for extractStr.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export interface ExtractStrConfig {
|
|
9
|
-
/**
|
|
10
|
-
* The minimum length of string literals to be extracted.
|
|
11
|
-
*
|
|
12
|
-
* @defaultValue `20`
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
strLength: number;
|
|
17
|
-
}
|
|
18
4
|
/**
|
|
19
5
|
* The options for ReactWebpackPlugin
|
|
20
6
|
*
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* A webpack plugin to integrate webpack with ReactLynx.
|
|
5
5
|
*/
|
|
6
6
|
export { ReactWebpackPlugin } from './ReactWebpackPlugin.js';
|
|
7
|
-
export type { ReactWebpackPluginOptions
|
|
7
|
+
export type { ReactWebpackPluginOptions } from './ReactWebpackPlugin.js';
|
|
8
|
+
export type { ExtractStrConfig } from '@lynx-js/react/transform';
|
|
8
9
|
export { LAYERS } from './layer.js';
|
|
9
10
|
export type { ReactLoaderOptions } from './loaders/options.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin-canary",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14-canary-20250522-fdab5dc9",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
"tiny-invariant": "^1.3.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@microsoft/api-extractor": "7.52.
|
|
41
|
-
"@rspack/core": "1.3.
|
|
40
|
+
"@microsoft/api-extractor": "7.52.8",
|
|
41
|
+
"@rspack/core": "1.3.11",
|
|
42
42
|
"css-loader": "^7.1.2",
|
|
43
43
|
"swc-loader": "^0.2.6",
|
|
44
|
-
"webpack": "^5.99.
|
|
45
|
-
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.
|
|
46
|
-
"@lynx-js/
|
|
47
|
-
"@lynx-js/
|
|
44
|
+
"webpack": "^5.99.9",
|
|
45
|
+
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.4-canary-20250522-fdab5dc9",
|
|
46
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.7.0-canary-20250522-fdab5dc9",
|
|
47
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.108.2-canary-20250522-fdab5dc9",
|
|
48
48
|
"@lynx-js/test-tools": "0.0.0",
|
|
49
|
-
"@lynx-js/
|
|
49
|
+
"@lynx-js/vitest-setup": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@lynx-js/react": "*",
|