@lynx-js/react-webpack-plugin-canary 0.6.7 → 0.6.8-canary-20250311-5e01cef3

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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # @lynx-js/react-webpack-plugin
2
2
 
3
+ ## 0.6.8-canary-20250311060757-5e01cef366a20d48b430b11eedbf9e5141f316a2
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
+ - Updated dependencies [[`ea27f28`](https://github.com/lynx-family/lynx-stack/commit/ea27f28b5a07acc12740e351f891d5e9af3b728c)]:
26
+ - @lynx-js/react@0.105.2-canary-20250311060757-5e01cef366a20d48b430b11eedbf9e5141f316a2
27
+
3
28
  ## 0.6.7
4
29
 
5
30
  ### Patch Changes
@@ -51,14 +76,14 @@
51
76
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
52
77
 
53
78
  ```js
54
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
55
- import { defineConfig } from '@lynx-js/rspeedy';
79
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
80
+ import { defineConfig } from "@lynx-js/rspeedy";
56
81
 
57
82
  export default defineConfig({
58
83
  plugins: [
59
84
  pluginReactLynx({
60
85
  defineDCE: {
61
- __SOME_FALSE_DEFINE__: 'false',
86
+ __SOME_FALSE_DEFINE__: "false",
62
87
  },
63
88
  }),
64
89
  ],
@@ -70,20 +95,20 @@
70
95
  For example, `import` initialized by dead code will be removed:
71
96
 
72
97
  ```js
73
- import { foo } from 'bar';
98
+ import { foo } from "bar";
74
99
 
75
100
  if (__SOME_FALSE_DEFINE__) {
76
101
  foo();
77
- console.log('dead code');
102
+ console.log("dead code");
78
103
  } else {
79
- console.log('reachable code');
104
+ console.log("reachable code");
80
105
  }
81
106
  ```
82
107
 
83
108
  will be transformed to:
84
109
 
85
110
  ```js
86
- console.log('reachable code');
111
+ console.log("reachable code");
87
112
  ```
88
113
 
89
114
  ## 0.6.0
@@ -93,14 +118,14 @@
93
118
  - a30c83d: Add `compat.removeComponentAttrRegex`.
94
119
 
95
120
  ```js
96
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
97
- import { defineConfig } from '@lynx-js/rspeedy';
121
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
122
+ import { defineConfig } from "@lynx-js/rspeedy";
98
123
 
99
124
  export default defineConfig({
100
125
  plugins: [
101
126
  pluginReactLynx({
102
127
  compat: {
103
- removeComponentAttrRegex: 'YOUR REGEX',
128
+ removeComponentAttrRegex: "YOUR REGEX",
104
129
  },
105
130
  }),
106
131
  ],
@@ -150,6 +150,7 @@ export function getMainThreadTransformOptions() {
150
150
  'useLayoutEffect',
151
151
  '__runInJS',
152
152
  'useLynxGlobalEventListener',
153
+ 'useImperativeHandle',
153
154
  ...(shake?.removeCallParams ?? []),
154
155
  ],
155
156
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-webpack-plugin-canary",
3
- "version": "0.6.7",
3
+ "version": "0.6.8-canary-20250311-5e01cef3",
4
4
  "description": "A webpack plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -42,8 +42,8 @@
42
42
  "css-loader": "^7.1.2",
43
43
  "swc-loader": "^0.2.6",
44
44
  "webpack": "^5.98.0",
45
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.105.1",
46
- "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.1",
45
+ "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.2-canary-20250311-5e01cef3",
46
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.105.2-canary-20250311-5e01cef3",
47
47
  "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.6.4",
48
48
  "@lynx-js/vitest-setup": "0.0.0",
49
49
  "@lynx-js/test-tools": "0.0.0"