@lynx-js/react-webpack-plugin-canary 0.9.0-canary-20260411-0fa3d027 → 0.9.0
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 +19 -21
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
-
## 0.9.0
|
|
3
|
+
## 0.9.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -8,16 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
`removeCall` removes matched runtime hook calls entirely, replacing them with `undefined` in expression positions and dropping them in statement positions. `removeCallParams` keeps the existing behavior of preserving the call while stripping its arguments.
|
|
10
10
|
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- Updated dependencies []:
|
|
14
|
-
- @lynx-js/template-webpack-plugin@0.10.8-canary-20260411083808-0fa3d0274a533a54f27cdc212b5a7375bc3e968d
|
|
15
|
-
|
|
16
11
|
## 0.8.0
|
|
17
12
|
|
|
18
13
|
### Minor Changes
|
|
19
14
|
|
|
20
15
|
- feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
|
|
16
|
+
|
|
21
17
|
- When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
|
|
22
18
|
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
|
|
23
19
|
|
|
@@ -26,6 +22,7 @@
|
|
|
26
22
|
- Fix sourcemap misalignment when wrapping lazy bundle main-thread chunks. ([#2361](https://github.com/lynx-family/lynx-stack/pull/2361))
|
|
27
23
|
|
|
28
24
|
The lazy bundle IIFE wrapper is now injected in `processAssets` at `PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE + 1` by walking chunk groups instead of patching assets in `beforeEncode`.
|
|
25
|
+
|
|
29
26
|
- With `experimental_isLazyBundle: true`, the wrapper is applied to lazy-bundle chunk groups.
|
|
30
27
|
- Without lazy bundle mode, the wrapper is applied to async main-thread chunk groups generated by dynamic import.
|
|
31
28
|
|
|
@@ -105,16 +102,16 @@
|
|
|
105
102
|
type InlineChunkConfig =
|
|
106
103
|
| boolean
|
|
107
104
|
| InlineChunkTest
|
|
108
|
-
| { enable?: boolean |
|
|
105
|
+
| { enable?: boolean | 'auto'; test: InlineChunkTest };
|
|
109
106
|
```
|
|
110
107
|
|
|
111
108
|
```ts
|
|
112
|
-
import { defineConfig } from
|
|
109
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
113
110
|
|
|
114
111
|
export default defineConfig({
|
|
115
112
|
output: {
|
|
116
113
|
inlineScripts: ({ name, size }) => {
|
|
117
|
-
return name.includes(
|
|
114
|
+
return name.includes('foo') && size < 1000;
|
|
118
115
|
},
|
|
119
116
|
},
|
|
120
117
|
});
|
|
@@ -169,6 +166,7 @@
|
|
|
169
166
|
- feat: fully support MTS ([#569](https://github.com/lynx-family/lynx-stack/pull/569))
|
|
170
167
|
|
|
171
168
|
Now use support the following usage
|
|
169
|
+
|
|
172
170
|
- mainthread event
|
|
173
171
|
- mainthread ref
|
|
174
172
|
- runOnMainThread/runOnBackground
|
|
@@ -197,7 +195,7 @@
|
|
|
197
195
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
198
196
|
|
|
199
197
|
```js
|
|
200
|
-
import { forwardRef, useImperativeHandle } from
|
|
198
|
+
import { forwardRef, useImperativeHandle } from '@lynx-js/react';
|
|
201
199
|
|
|
202
200
|
export default forwardRef(function App(_, ref) {
|
|
203
201
|
useImperativeHandle(ref, () => {
|
|
@@ -205,7 +203,7 @@
|
|
|
205
203
|
return {
|
|
206
204
|
name() {
|
|
207
205
|
// This should be considered as background only
|
|
208
|
-
console.info(
|
|
206
|
+
console.info('This should not exist in main-thread');
|
|
209
207
|
},
|
|
210
208
|
};
|
|
211
209
|
});
|
|
@@ -265,14 +263,14 @@
|
|
|
265
263
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
266
264
|
|
|
267
265
|
```js
|
|
268
|
-
import { pluginReactLynx } from
|
|
269
|
-
import { defineConfig } from
|
|
266
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
|
|
267
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
270
268
|
|
|
271
269
|
export default defineConfig({
|
|
272
270
|
plugins: [
|
|
273
271
|
pluginReactLynx({
|
|
274
272
|
defineDCE: {
|
|
275
|
-
__SOME_FALSE_DEFINE__:
|
|
273
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
276
274
|
},
|
|
277
275
|
}),
|
|
278
276
|
],
|
|
@@ -284,20 +282,20 @@
|
|
|
284
282
|
For example, `import` initialized by dead code will be removed:
|
|
285
283
|
|
|
286
284
|
```js
|
|
287
|
-
import { foo } from
|
|
285
|
+
import { foo } from 'bar';
|
|
288
286
|
|
|
289
287
|
if (__SOME_FALSE_DEFINE__) {
|
|
290
288
|
foo();
|
|
291
|
-
console.log(
|
|
289
|
+
console.log('dead code');
|
|
292
290
|
} else {
|
|
293
|
-
console.log(
|
|
291
|
+
console.log('reachable code');
|
|
294
292
|
}
|
|
295
293
|
```
|
|
296
294
|
|
|
297
295
|
will be transformed to:
|
|
298
296
|
|
|
299
297
|
```js
|
|
300
|
-
console.log(
|
|
298
|
+
console.log('reachable code');
|
|
301
299
|
```
|
|
302
300
|
|
|
303
301
|
## 0.6.0
|
|
@@ -307,14 +305,14 @@
|
|
|
307
305
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
308
306
|
|
|
309
307
|
```js
|
|
310
|
-
import { pluginReactLynx } from
|
|
311
|
-
import { defineConfig } from
|
|
308
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
|
|
309
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
312
310
|
|
|
313
311
|
export default defineConfig({
|
|
314
312
|
plugins: [
|
|
315
313
|
pluginReactLynx({
|
|
316
314
|
compat: {
|
|
317
|
-
removeComponentAttrRegex:
|
|
315
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
318
316
|
},
|
|
319
317
|
}),
|
|
320
318
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin-canary",
|
|
3
|
-
"version": "0.9.0
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"swc-loader": "^0.2.7",
|
|
44
44
|
"webpack": "^5.105.2",
|
|
45
45
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.7.0",
|
|
46
|
-
"@lynx-js/
|
|
47
|
-
"@lynx-js/
|
|
46
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.118.0",
|
|
47
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.8",
|
|
48
48
|
"@lynx-js/test-tools": "0.0.0",
|
|
49
49
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
50
50
|
},
|