@lynx-js/react-webpack-plugin-canary 0.7.4 → 0.7.5-canary-20260310-27f1cffb

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,14 @@
1
1
  # @lynx-js/react-webpack-plugin
2
2
 
3
+ ## 0.7.5-canary-20260310085803-27f1cffbea99585b547aff669b8e230533987036
4
+
5
+ ### Patch Changes
6
+
7
+ - Set `__DEV__` and `__PROFILE__` to `true` on `NODE_ENV === 'development'`. ([#2324](https://github.com/lynx-family/lynx-stack/pull/2324))
8
+
9
+ - Updated dependencies []:
10
+ - @lynx-js/template-webpack-plugin@0.10.6-canary-20260310085803-27f1cffbea99585b547aff669b8e230533987036
11
+
3
12
  ## 0.7.4
4
13
 
5
14
  ### Patch Changes
@@ -72,16 +81,16 @@
72
81
  type InlineChunkConfig =
73
82
  | boolean
74
83
  | InlineChunkTest
75
- | { enable?: boolean | 'auto'; test: InlineChunkTest };
84
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
76
85
  ```
77
86
 
78
87
  ```ts
79
- import { defineConfig } from '@lynx-js/rspeedy';
88
+ import { defineConfig } from "@lynx-js/rspeedy";
80
89
 
81
90
  export default defineConfig({
82
91
  output: {
83
92
  inlineScripts: ({ name, size }) => {
84
- return name.includes('foo') && size < 1000;
93
+ return name.includes("foo") && size < 1000;
85
94
  },
86
95
  },
87
96
  });
@@ -136,7 +145,6 @@
136
145
  - feat: fully support MTS ([#569](https://github.com/lynx-family/lynx-stack/pull/569))
137
146
 
138
147
  Now use support the following usage
139
-
140
148
  - mainthread event
141
149
  - mainthread ref
142
150
  - runOnMainThread/runOnBackground
@@ -165,7 +173,7 @@
165
173
  - Shake `useImperativeHandle` on the main-thread by default. ([#153](https://github.com/lynx-family/lynx-stack/pull/153))
166
174
 
167
175
  ```js
168
- import { forwardRef, useImperativeHandle } from '@lynx-js/react';
176
+ import { forwardRef, useImperativeHandle } from "@lynx-js/react";
169
177
 
170
178
  export default forwardRef(function App(_, ref) {
171
179
  useImperativeHandle(ref, () => {
@@ -173,7 +181,7 @@
173
181
  return {
174
182
  name() {
175
183
  // This should be considered as background only
176
- console.info('This should not exist in main-thread');
184
+ console.info("This should not exist in main-thread");
177
185
  },
178
186
  };
179
187
  });
@@ -233,14 +241,14 @@
233
241
  - e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
234
242
 
235
243
  ```js
236
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
237
- import { defineConfig } from '@lynx-js/rspeedy';
244
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
245
+ import { defineConfig } from "@lynx-js/rspeedy";
238
246
 
239
247
  export default defineConfig({
240
248
  plugins: [
241
249
  pluginReactLynx({
242
250
  defineDCE: {
243
- __SOME_FALSE_DEFINE__: 'false',
251
+ __SOME_FALSE_DEFINE__: "false",
244
252
  },
245
253
  }),
246
254
  ],
@@ -252,20 +260,20 @@
252
260
  For example, `import` initialized by dead code will be removed:
253
261
 
254
262
  ```js
255
- import { foo } from 'bar';
263
+ import { foo } from "bar";
256
264
 
257
265
  if (__SOME_FALSE_DEFINE__) {
258
266
  foo();
259
- console.log('dead code');
267
+ console.log("dead code");
260
268
  } else {
261
- console.log('reachable code');
269
+ console.log("reachable code");
262
270
  }
263
271
  ```
264
272
 
265
273
  will be transformed to:
266
274
 
267
275
  ```js
268
- console.log('reachable code');
276
+ console.log("reachable code");
269
277
  ```
270
278
 
271
279
  ## 0.6.0
@@ -275,14 +283,14 @@
275
283
  - a30c83d: Add `compat.removeComponentAttrRegex`.
276
284
 
277
285
  ```js
278
- import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';
279
- import { defineConfig } from '@lynx-js/rspeedy';
286
+ import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
287
+ import { defineConfig } from "@lynx-js/rspeedy";
280
288
 
281
289
  export default defineConfig({
282
290
  plugins: [
283
291
  pluginReactLynx({
284
292
  compat: {
285
- removeComponentAttrRegex: 'YOUR REGEX',
293
+ removeComponentAttrRegex: "YOUR REGEX",
286
294
  },
287
295
  }),
288
296
  ],
@@ -100,13 +100,15 @@ class ReactWebpackPlugin {
100
100
  // Use undefined for variables that must be provided during bundling, or null if they are optional.
101
101
  DEBUG: null,
102
102
  }).apply(compiler);
103
+ const isDev = process.env['NODE_ENV'] === 'development'
104
+ || compiler.options.mode === 'development';
103
105
  new DefinePlugin({
104
- __DEV__: JSON.stringify(compiler.options.mode === 'development'),
106
+ __DEV__: isDev,
105
107
  // We enable profile by default in development.
106
108
  // It can also be disabled by environment variable `REACT_PROFILE=false`
107
109
  __PROFILE__: JSON.stringify(process.env['REACT_PROFILE']
108
110
  ?? options.profile
109
- ?? compiler.options.mode === 'development'),
111
+ ?? isDev),
110
112
  // User can enable ALog by environment variable `REACT_ALOG=true`
111
113
  __ALOG__: JSON.stringify(Boolean(process.env['REACT_ALOG'])),
112
114
  // User can enable ALog of element API calls by environment variable `REACT_ALOG_ELEMENT_API=true`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-webpack-plugin-canary",
3
- "version": "0.7.4",
3
+ "version": "0.7.5-canary-20260310-27f1cffb",
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.56.3",
41
- "@rspack/core": "1.7.6",
40
+ "@microsoft/api-extractor": "7.57.6",
41
+ "@rspack/core": "1.7.7",
42
42
  "css-loader": "^7.1.4",
43
43
  "swc-loader": "^0.2.7",
44
44
  "webpack": "^5.105.2",
45
- "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.3",
46
- "@lynx-js/test-tools": "0.0.0",
47
- "@lynx-js/react": "npm:@lynx-js/react-canary@0.116.3",
48
45
  "@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.7.0",
49
- "@lynx-js/vitest-setup": "0.0.0"
46
+ "@lynx-js/template-webpack-plugin": "npm:@lynx-js/template-webpack-plugin-canary@0.10.6-canary-20260310-27f1cffb",
47
+ "@lynx-js/react": "npm:@lynx-js/react-canary@0.116.6-canary-20260310-27f1cffb",
48
+ "@lynx-js/vitest-setup": "0.0.0",
49
+ "@lynx-js/test-tools": "0.0.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@lynx-js/template-webpack-plugin": "*"