@lynx-js/react-webpack-plugin 0.6.6 → 0.6.8
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 +33 -0
- package/lib/ReactWebpackPlugin.d.ts +6 -0
- package/lib/ReactWebpackPlugin.js +9 -6
- package/lib/loaders/options.js +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.6.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import { forwardRef, useImperativeHandle } from '@lynx-js/react';
|
|
11
|
+
|
|
12
|
+
export default forwardRef(function App(_, ref) {
|
|
13
|
+
useImperativeHandle(ref, () => {
|
|
14
|
+
// This should be considered as background only
|
|
15
|
+
return {
|
|
16
|
+
name() {
|
|
17
|
+
// This should be considered as background only
|
|
18
|
+
console.info('This should not exist in main-thread');
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Avoid wrapping standalone lazy bundles with `var globDynamicComponentEntry`. ([#177](https://github.com/lynx-family/lynx-stack/pull/177))
|
|
26
|
+
|
|
27
|
+
## 0.6.7
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Support NPM provenance. ([#30](https://github.com/lynx-family/lynx-stack/pull/30))
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [[`c617453`](https://github.com/lynx-family/lynx-stack/commit/c617453aea967aba702967deb2916b5c883f03bb)]:
|
|
34
|
+
- @lynx-js/webpack-runtime-globals@0.0.5
|
|
35
|
+
|
|
3
36
|
## 0.6.6
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -18,6 +18,12 @@ interface ReactWebpackPluginOptions {
|
|
|
18
18
|
* The chunk names to be considered as main thread chunks.
|
|
19
19
|
*/
|
|
20
20
|
mainThreadChunks?: string[] | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to enable lazy bundle.
|
|
23
|
+
*
|
|
24
|
+
* @alpha
|
|
25
|
+
*/
|
|
26
|
+
experimental_isLazyBundle?: boolean;
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
23
29
|
* ReactWebpackPlugin allows using ReactLynx with webpack
|
|
@@ -74,6 +74,7 @@ class ReactWebpackPlugin {
|
|
|
74
74
|
disableCreateSelectorQueryIncompatibleWarning: false,
|
|
75
75
|
firstScreenSyncTiming: 'immediately',
|
|
76
76
|
mainThreadChunks: [],
|
|
77
|
+
experimental_isLazyBundle: false,
|
|
77
78
|
}); }
|
|
78
79
|
/**
|
|
79
80
|
* The entry point of a webpack plugin.
|
|
@@ -82,12 +83,14 @@ class ReactWebpackPlugin {
|
|
|
82
83
|
apply(compiler) {
|
|
83
84
|
const options = Object.assign({}, ReactWebpackPlugin.defaultOptions, this.options);
|
|
84
85
|
const { BannerPlugin, DefinePlugin, EnvironmentPlugin } = compiler.webpack;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
if (!options.experimental_isLazyBundle) {
|
|
87
|
+
new BannerPlugin({
|
|
88
|
+
// TODO: handle cases that do not have `'use strict'`
|
|
89
|
+
banner: `'use strict';var globDynamicComponentEntry=globDynamicComponentEntry||'__Card__';`,
|
|
90
|
+
raw: true,
|
|
91
|
+
test: options.mainThreadChunks,
|
|
92
|
+
}).apply(compiler);
|
|
93
|
+
}
|
|
91
94
|
new EnvironmentPlugin({
|
|
92
95
|
// Default values of null and undefined behave differently.
|
|
93
96
|
// Use undefined for variables that must be provided during bundling, or null if they are optional.
|
package/lib/loaders/options.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/lynx-
|
|
12
|
+
"url": "https://github.com/lynx-family/lynx-stack.git",
|
|
13
13
|
"directory": "packages/webpack/react-webpack-plugin"
|
|
14
14
|
},
|
|
15
15
|
"license": "Apache-2.0",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"tiny-invariant": "^1.3.3",
|
|
37
|
-
"@lynx-js/webpack-runtime-globals": "0.0.
|
|
37
|
+
"@lynx-js/webpack-runtime-globals": "0.0.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@microsoft/api-extractor": "7.51.
|
|
41
|
-
"@rspack/core": "1.2.
|
|
40
|
+
"@microsoft/api-extractor": "7.51.1",
|
|
41
|
+
"@rspack/core": "1.2.8",
|
|
42
42
|
"css-loader": "^7.1.2",
|
|
43
43
|
"swc-loader": "^0.2.6",
|
|
44
44
|
"webpack": "^5.98.0",
|
|
45
|
-
"@lynx-js/css-extract-webpack-plugin": "0.5.
|
|
46
|
-
"@lynx-js/react": "0.105.
|
|
47
|
-
"@lynx-js/template-webpack-plugin": "0.6.
|
|
45
|
+
"@lynx-js/css-extract-webpack-plugin": "0.5.2",
|
|
46
|
+
"@lynx-js/react": "0.105.2",
|
|
47
|
+
"@lynx-js/template-webpack-plugin": "0.6.5",
|
|
48
48
|
"@lynx-js/test-tools": "0.0.0",
|
|
49
49
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
50
50
|
},
|