@lynx-js/react-webpack-plugin-canary 0.9.5-canary-20260703-a73bd993 → 0.9.5
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 +20 -19
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
-
## 0.9.5
|
|
3
|
+
## 0.9.5
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Support enabling preact devtools in production via the `REACT_DEVTOOL` environment variable. ([#2880](https://github.com/lynx-family/lynx-stack/pull/2880))
|
|
8
8
|
|
|
9
9
|
By default `@lynx-js/preact-devtools` is aliased away in production builds. Setting the `REACT_DEVTOOL` environment variable now:
|
|
10
|
+
|
|
10
11
|
1. keeps a user-imported `@lynx-js/preact-devtools` from being stripped;
|
|
11
12
|
2. defines `__REACT_DEVTOOL__`, which gates the dev-only runtime hooks devtools depends on (such as `injectLepusMethods`) so they also run in production;
|
|
12
13
|
3. keeps function/class names during minification (`keep_fnames`/`keep_classnames`), which devtools needs to resolve component names (`type.name`) and to reconstruct the hook tree (it matches minified stack frames by function name).
|
|
13
14
|
|
|
14
15
|
`@lynx-js/react/debug` remains development-only.
|
|
15
16
|
|
|
16
|
-
- Updated dependencies []:
|
|
17
|
-
- @lynx-js/template-webpack-plugin@0.12.2-canary-20260703080527-a73bd9933968f265b6fb7a6b295bd759df2997dc
|
|
18
|
-
|
|
19
17
|
## 0.9.4
|
|
20
18
|
|
|
21
19
|
### Patch Changes
|
|
@@ -66,6 +64,7 @@
|
|
|
66
64
|
### Minor Changes
|
|
67
65
|
|
|
68
66
|
- feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
|
|
67
|
+
|
|
69
68
|
- When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
|
|
70
69
|
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
|
|
71
70
|
|
|
@@ -74,6 +73,7 @@
|
|
|
74
73
|
- Fix sourcemap misalignment when wrapping lazy bundle main-thread chunks. ([#2361](https://github.com/lynx-family/lynx-stack/pull/2361))
|
|
75
74
|
|
|
76
75
|
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`.
|
|
76
|
+
|
|
77
77
|
- With `experimental_isLazyBundle: true`, the wrapper is applied to lazy-bundle chunk groups.
|
|
78
78
|
- Without lazy bundle mode, the wrapper is applied to async main-thread chunk groups generated by dynamic import.
|
|
79
79
|
|
|
@@ -153,16 +153,16 @@
|
|
|
153
153
|
type InlineChunkConfig =
|
|
154
154
|
| boolean
|
|
155
155
|
| InlineChunkTest
|
|
156
|
-
| { enable?: boolean |
|
|
156
|
+
| { enable?: boolean | 'auto'; test: InlineChunkTest };
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
```ts
|
|
160
|
-
import { defineConfig } from
|
|
160
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
161
161
|
|
|
162
162
|
export default defineConfig({
|
|
163
163
|
output: {
|
|
164
164
|
inlineScripts: ({ name, size }) => {
|
|
165
|
-
return name.includes(
|
|
165
|
+
return name.includes('foo') && size < 1000;
|
|
166
166
|
},
|
|
167
167
|
},
|
|
168
168
|
});
|
|
@@ -217,6 +217,7 @@
|
|
|
217
217
|
- feat: fully support MTS ([#569](https://github.com/lynx-family/lynx-stack/pull/569))
|
|
218
218
|
|
|
219
219
|
Now use support the following usage
|
|
220
|
+
|
|
220
221
|
- mainthread event
|
|
221
222
|
- mainthread ref
|
|
222
223
|
- runOnMainThread/runOnBackground
|
|
@@ -245,7 +246,7 @@
|
|
|
245
246
|
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
246
247
|
|
|
247
248
|
```js
|
|
248
|
-
import { forwardRef, useImperativeHandle } from
|
|
249
|
+
import { forwardRef, useImperativeHandle } from '@lynx-js/react';
|
|
249
250
|
|
|
250
251
|
export default forwardRef(function App(_, ref) {
|
|
251
252
|
useImperativeHandle(ref, () => {
|
|
@@ -253,7 +254,7 @@
|
|
|
253
254
|
return {
|
|
254
255
|
name() {
|
|
255
256
|
// This should be considered as background only
|
|
256
|
-
console.info(
|
|
257
|
+
console.info('This should not exist in main-thread');
|
|
257
258
|
},
|
|
258
259
|
};
|
|
259
260
|
});
|
|
@@ -313,14 +314,14 @@
|
|
|
313
314
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
314
315
|
|
|
315
316
|
```js
|
|
316
|
-
import { pluginReactLynx } from
|
|
317
|
-
import { defineConfig } from
|
|
317
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
|
|
318
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
318
319
|
|
|
319
320
|
export default defineConfig({
|
|
320
321
|
plugins: [
|
|
321
322
|
pluginReactLynx({
|
|
322
323
|
defineDCE: {
|
|
323
|
-
__SOME_FALSE_DEFINE__:
|
|
324
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
324
325
|
},
|
|
325
326
|
}),
|
|
326
327
|
],
|
|
@@ -332,20 +333,20 @@
|
|
|
332
333
|
For example, `import` initialized by dead code will be removed:
|
|
333
334
|
|
|
334
335
|
```js
|
|
335
|
-
import { foo } from
|
|
336
|
+
import { foo } from 'bar';
|
|
336
337
|
|
|
337
338
|
if (__SOME_FALSE_DEFINE__) {
|
|
338
339
|
foo();
|
|
339
|
-
console.log(
|
|
340
|
+
console.log('dead code');
|
|
340
341
|
} else {
|
|
341
|
-
console.log(
|
|
342
|
+
console.log('reachable code');
|
|
342
343
|
}
|
|
343
344
|
```
|
|
344
345
|
|
|
345
346
|
will be transformed to:
|
|
346
347
|
|
|
347
348
|
```js
|
|
348
|
-
console.log(
|
|
349
|
+
console.log('reachable code');
|
|
349
350
|
```
|
|
350
351
|
|
|
351
352
|
## 0.6.0
|
|
@@ -355,14 +356,14 @@
|
|
|
355
356
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
356
357
|
|
|
357
358
|
```js
|
|
358
|
-
import { pluginReactLynx } from
|
|
359
|
-
import { defineConfig } from
|
|
359
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
|
|
360
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
360
361
|
|
|
361
362
|
export default defineConfig({
|
|
362
363
|
plugins: [
|
|
363
364
|
pluginReactLynx({
|
|
364
365
|
compat: {
|
|
365
|
-
removeComponentAttrRegex:
|
|
366
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
366
367
|
},
|
|
367
368
|
}),
|
|
368
369
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin-canary",
|
|
3
|
-
"version": "0.9.5
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"css-loader": "^7.1.4",
|
|
46
46
|
"swc-loader": "^0.2.7",
|
|
47
47
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.8.0",
|
|
48
|
-
"@lynx-js/
|
|
49
|
-
"@lynx-js/
|
|
50
|
-
"@lynx-js/
|
|
48
|
+
"@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.12.2",
|
|
49
|
+
"@lynx-js/test-tools": "0.0.0",
|
|
50
|
+
"@lynx-js/react": "npm:@lynx-js/react-canary@0.122.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@lynx-js/template-webpack-plugin": "*"
|