@lynx-js/react-alias-rsbuild-plugin 0.18.3 → 0.19.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @lynx-js/react-alias-rsbuild-plugin
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Apply ReactLynx aliases to every generated bundler chain so repeated Rsbuild config initialization, including Rstest, retains the plugin's resolve configuration. ([#3501](https://github.com/lynx-family/lynx-stack/pull/3501))
8
+
9
+ - Add `@lynx-js/react-signals`, a thread-aware Preact Signals adapter that keeps Signals dependencies out of `@lynx-js/react`. Signal reactivity runs on the background thread, while main-thread rendering uses static signal values with inactive setters, subscriptions, and effects. ([#3346](https://github.com/lynx-family/lynx-stack/pull/3346))
10
+
3
11
  ## 0.18.3
4
12
 
5
13
  ## 0.18.2
package/dist/index.js CHANGED
@@ -415,8 +415,8 @@ function pluginReactAlias(options) {
415
415
  ]
416
416
  }
417
417
  }));
418
- api.modifyBundlerChain(async (chain, { isProd, environment, rspack })=>{
419
- if (Object.hasOwn(environment, S_PLUGIN_REACT_ALIAS)) return;
418
+ api.modifyBundlerChain(async (chain, { isProd, rspack })=>{
419
+ if (Object.hasOwn(chain, S_PLUGIN_REACT_ALIAS)) return;
420
420
  const resolve = createLazyResolver(rspack, rootPath ?? api.context.rootPath, lazy ? [
421
421
  'lazy',
422
422
  'import'
@@ -429,7 +429,7 @@ function pluginReactAlias(options) {
429
429
  api.expose(Symbol.for('@lynx-js/react/internal:resolve'), {
430
430
  resolve
431
431
  });
432
- Object.defineProperty(environment, S_PLUGIN_REACT_ALIAS, {
432
+ Object.defineProperty(chain, S_PLUGIN_REACT_ALIAS, {
433
433
  value: true
434
434
  });
435
435
  const [jsxRuntimeBackground, jsxRuntimeMainThread, jsxDevRuntimeBackground, jsxDevRuntimeMainThread, elementTemplateJsxRuntime, elementTemplateJsxDevRuntime, preactHooks, hooksBackground, hooksMainThread, reactLepusBackground, reactLepusMainThread, reactCompat, elementTemplateEntry, elementTemplateInternalEntry] = await Promise.all([
@@ -465,7 +465,8 @@ function pluginReactAlias(options) {
465
465
  background: hooksBackground,
466
466
  preact: preactHooks
467
467
  };
468
- chain.module.rule('react:jsx-runtime:main-thread').issuerLayer(LAYERS.MAIN_THREAD).resolve.alias.set('react/jsx-runtime', jsxRuntime.mainThread).set('react/jsx-dev-runtime', jsxDevRuntime.mainThread).set('@lynx-js/react/jsx-runtime', jsxRuntime.mainThread).set('@lynx-js/react/jsx-dev-runtime', jsxDevRuntime.mainThread).set('@lynx-js/react/lepus$', reactLepus.mainThread).set('@lynx-js/react/lepus/jsx-runtime', jsxRuntime.mainThread).set('@lynx-js/react/lepus/jsx-dev-runtime', jsxDevRuntime.mainThread).set('preact/hooks', reactHooks.mainThread).set('@lynx-js/react/hooks', reactHooks.mainThread).set('@lynx-js/react/lepus/hooks', reactHooks.mainThread).end().end().end().rule('react:jsx-runtime:background').issuerLayer(LAYERS.BACKGROUND).resolve.alias.set('react/jsx-runtime', jsxRuntime.background).set('react/jsx-dev-runtime', jsxDevRuntime.background).set('@lynx-js/react/jsx-runtime', jsxRuntime.background).set('@lynx-js/react/jsx-dev-runtime', jsxDevRuntime.background).set('@lynx-js/react/lepus$', elementTemplateEntry ?? reactLepus.background).set('preact/hooks', reactHooks.preact).set('@lynx-js/react/hooks', reactHooks.background).end().end().end().end();
468
+ const signalsMainThread = '@lynx-js/react-signals/lepus';
469
+ chain.module.rule('react:jsx-runtime:main-thread').issuerLayer(LAYERS.MAIN_THREAD).resolve.alias.set('react/jsx-runtime', jsxRuntime.mainThread).set('react/jsx-dev-runtime', jsxDevRuntime.mainThread).set('@lynx-js/react/jsx-runtime', jsxRuntime.mainThread).set('@lynx-js/react/jsx-dev-runtime', jsxDevRuntime.mainThread).set('@lynx-js/react/lepus$', reactLepus.mainThread).set('@lynx-js/react/lepus/jsx-runtime', jsxRuntime.mainThread).set('@lynx-js/react/lepus/jsx-dev-runtime', jsxDevRuntime.mainThread).set('preact/hooks', reactHooks.mainThread).set('@lynx-js/react/hooks', reactHooks.mainThread).set('@lynx-js/react/lepus/hooks', reactHooks.mainThread).set('@lynx-js/react-signals$', signalsMainThread).end().end().end().rule('react:jsx-runtime:background').issuerLayer(LAYERS.BACKGROUND).resolve.alias.set('react/jsx-runtime', jsxRuntime.background).set('react/jsx-dev-runtime', jsxDevRuntime.background).set('@lynx-js/react/jsx-runtime', jsxRuntime.background).set('@lynx-js/react/jsx-dev-runtime', jsxDevRuntime.background).set('@lynx-js/react/lepus$', elementTemplateEntry ?? reactLepus.background).set('preact/hooks', reactHooks.preact).set('@lynx-js/react/hooks', reactHooks.background).end().end().end().end();
469
470
  const transformedEntries = [
470
471
  'experimental/lazy/import',
471
472
  'internal',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-alias-rsbuild-plugin",
3
- "version": "0.18.3",
3
+ "version": "0.19.0",
4
4
  "description": "A rsbuild plugin for making alias in ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -33,13 +33,13 @@
33
33
  ],
34
34
  "devDependencies": {
35
35
  "@microsoft/api-extractor": "7.58.12",
36
- "@rsbuild/core": "2.1.7",
36
+ "@rsbuild/core": "2.1.10",
37
37
  "@rspack/core": "2.1.7",
38
- "@rstest/core": "0.11.3",
39
- "@types/semver": "^7.7.1",
40
- "semver": "^7.7.4",
41
- "@lynx-js/react": "0.123.3",
42
- "@lynx-js/react-webpack-plugin": "0.10.3",
38
+ "@rstest/core": "0.11.6",
39
+ "@types/semver": "^7.8.0",
40
+ "semver": "^7.8.5",
41
+ "@lynx-js/react": "0.124.0",
42
+ "@lynx-js/react-webpack-plugin": "0.11.0",
43
43
  "@lynx-js/test-tools": "0.0.0"
44
44
  },
45
45
  "engines": {