diff --git a/.changeset/tidy-buttons-tie.md b/.changeset/tidy-buttons-tie.md new file mode 100644 index 0000000000..6ef8e13c6b --- /dev/null +++ b/.changeset/tidy-buttons-tie.md @@ -0,0 +1,8 @@ +--- +'@lynx-js/react': minor +'@lynx-js/react-umd': minor +'@lynx-js/react-alias-rsbuild-plugin': minor +'@lynx-js/lynx-bundle-rslib-config': 'minor' +--- + +Export constants in `@lynx-js/react/constants` diff --git a/packages/react-umd/src/index.ts b/packages/react-umd/src/index.ts index cef18399a5..e21621b15b 100644 --- a/packages/react-umd/src/index.ts +++ b/packages/react-umd/src/index.ts @@ -4,6 +4,7 @@ export * as React from '@lynx-js/react'; export * as ReactInternal from '@lynx-js/react/internal'; +export * as ReactConstants from '@lynx-js/react/constants'; export * as ReactJSXDevRuntime from '@lynx-js/react/jsx-dev-runtime'; export * as ReactJSXRuntime from '@lynx-js/react/jsx-runtime'; export * as ReactJSXLepusDevRuntime from '@lynx-js/react/lepus/jsx-dev-runtime'; diff --git a/packages/react/package.json b/packages/react/package.json index b30bbeded1..270429face 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -37,6 +37,11 @@ "types": "./runtime/lib/document.d.ts", "default": "./runtime/lib/document.js" }, + "./constants": { + "types": "./runtime/lib/constants.d.ts", + "lazy": "./runtime/lazy/constants.js", + "default": "./runtime/lib/constants.js" + }, "./jsx-runtime": { "types": "./runtime/jsx-runtime/index.d.ts", "lazy": "./runtime/lazy/jsx-runtime.js", @@ -121,6 +126,9 @@ "internal/document": [ "./runtime/lib/document.d.ts" ], + "constants": [ + "./runtime/lib/constants.d.ts" + ], "jsx-runtime": [ "./runtime/jsx-runtime/index.d.ts" ], diff --git a/packages/react/runtime/__test__/lazy.test.js b/packages/react/runtime/__test__/lazy.test.js index c058f63ff9..7ec62c7144 100644 --- a/packages/react/runtime/__test__/lazy.test.js +++ b/packages/react/runtime/__test__/lazy.test.js @@ -5,6 +5,7 @@ import * as ReactExports from '../lazy/react.js'; import * as ReactCompatExports from '../lazy/compat.js'; import * as ReactLepusExports from '../lazy/react-lepus.js'; import * as ReactInternalExports from '../lazy/internal.js'; +import * as ReactConstantsExports from '../lazy/constants.js'; import * as ReactJSXRuntimeExports from '../lazy/jsx-runtime.js'; import * as ReactJSXDevRuntimeExports from '../lazy/jsx-dev-runtime.js'; import * as ReactLegacyReactRuntimeExports from '../lazy/legacy-react-runtime.js'; @@ -62,6 +63,19 @@ describe('Lazy Exports', () => { ); }); + test('export APIs from "constants"', async () => { + const realAPIs = Object.assign( + {}, + await import('@lynx-js/react/constants'), + ); + + expect( + new Set(Object.keys(ReactConstantsExports)), + ).toStrictEqual( + new Set(Object.keys(realAPIs)), + ); + }); + test('export APIs from "jsx-runtime"', async () => { const realAPIs = Object.assign( {}, diff --git a/packages/react/runtime/lazy/constants.js b/packages/react/runtime/lazy/constants.js new file mode 100644 index 0000000000..b47f95747f --- /dev/null +++ b/packages/react/runtime/lazy/constants.js @@ -0,0 +1,16 @@ +// Copyright 2024 The Lynx Authors. All rights reserved. +// Licensed under the Apache License Version 2.0 that can be found in the +// LICENSE file in the root directory of this source tree. + +import { sExportsReactConstants, target } from './target.js'; + +export const { + CHILDREN, + COMPONENT, + DIFF, + DIRTY, + DOM, + FLAGS, + INDEX, + PARENT, +} = target[sExportsReactConstants]; diff --git a/packages/react/runtime/lazy/import.js b/packages/react/runtime/lazy/import.js index 6448017762..c0b0d6df13 100644 --- a/packages/react/runtime/lazy/import.js +++ b/packages/react/runtime/lazy/import.js @@ -4,6 +4,7 @@ import * as ReactAPIs from '@lynx-js/react'; import * as ReactCompatAPIS from '@lynx-js/react/compat'; import * as ReactInternal from '@lynx-js/react/internal'; +import * as ReactConstants from '@lynx-js/react/constants'; import * as ReactJSXDevRuntime from '@lynx-js/react/jsx-dev-runtime'; import * as ReactJSXRuntime from '@lynx-js/react/jsx-runtime'; import * as ReactLegacyReactRuntime from '@lynx-js/react/legacy-react-runtime'; @@ -16,6 +17,7 @@ import { sExportsReact, sExportsReactCompat, sExportsReactInternal, + sExportsReactConstants, sExportsReactLepus, target, } from './target.js'; @@ -48,6 +50,13 @@ Object.defineProperty(target, sExportsReactInternal, { configurable: true, }); +Object.defineProperty(target, sExportsReactConstants, { + value: ReactConstants, + enumerable: false, + writable: false, + configurable: true, +}); + Object.defineProperty(target, sExportsJSXRuntime, { value: ReactJSXRuntime, enumerable: false, diff --git a/packages/react/runtime/lazy/internal.js b/packages/react/runtime/lazy/internal.js index 8093ba94c9..c9bb4ce2bb 100644 --- a/packages/react/runtime/lazy/internal.js +++ b/packages/react/runtime/lazy/internal.js @@ -6,15 +6,7 @@ import { sExportsReactInternal, target } from './target.js'; export const { BackgroundSnapshotInstance, - CHILDREN, - COMPONENT, Component, - DIFF, - DIRTY, - DOM, - FLAGS, - INDEX, - PARENT, __ComponentIsPolyfill, __DynamicPartChildren, __DynamicPartChildren_0, diff --git a/packages/react/runtime/lazy/target.js b/packages/react/runtime/lazy/target.js index 5564f0fd3a..568191caad 100644 --- a/packages/react/runtime/lazy/target.js +++ b/packages/react/runtime/lazy/target.js @@ -7,6 +7,7 @@ export const sExportsReact = Symbol.for('__REACT_LYNX_EXPORTS__(@lynx-js/react)' export const sExportsReactCompat = Symbol.for('__REACT_LYNX_EXPORTS__(@lynx-js/react/compat)'); export const sExportsReactLepus = Symbol.for('__REACT_LYNX_EXPORTS__(@lynx-js/react/lepus)'); export const sExportsReactInternal = Symbol.for('__REACT_LYNX_EXPORTS__(@lynx-js/react/internal)'); +export const sExportsReactConstants = Symbol.for('__REACT_LYNX_EXPORTS__(@lynx-js/react/constants)'); export const sExportsJSXRuntime = Symbol.for('__REACT_LYNX_EXPORTS__(@lynx-js/react/jsx-runtime)'); export const sExportsJSXDevRuntime = Symbol.for('__REACT_LYNX_EXPORTS__(@lynx-js/react/jsx-dev-runtime)'); export const sExportsLegacyReactRuntime = Symbol.for('__REACT_LYNX_EXPORTS__(@lynx-js/react/legacy-react-runtime)'); diff --git a/packages/react/runtime/lepus/jsx-runtime/index.js b/packages/react/runtime/lepus/jsx-runtime/index.js index e5a4d803eb..aa1d29c502 100644 --- a/packages/react/runtime/lepus/jsx-runtime/index.js +++ b/packages/react/runtime/lepus/jsx-runtime/index.js @@ -1,7 +1,8 @@ // Copyright 2024 The Lynx Authors. All rights reserved. // Licensed under the Apache License Version 2.0 that can be found in the // LICENSE file in the root directory of this source tree. -import { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT, SnapshotInstance } from '@lynx-js/react/internal'; +import { SnapshotInstance } from '@lynx-js/react/internal'; +import { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT } from '@lynx-js/react/constants'; function createVNode(type, props, _key) { if (typeof type === 'string') { diff --git a/packages/react/runtime/src/constants.ts b/packages/react/runtime/src/constants.ts new file mode 100644 index 0000000000..283d2afe89 --- /dev/null +++ b/packages/react/runtime/src/constants.ts @@ -0,0 +1,5 @@ +// Copyright 2026 The Lynx Authors. All rights reserved. +// Licensed under the Apache License Version 2.0 that can be found in the +// LICENSE file in the root directory of this source tree. + +export { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT } from './renderToOpcodes/constants.js'; diff --git a/packages/react/runtime/src/internal.ts b/packages/react/runtime/src/internal.ts index 043b77c151..8aaaa9c863 100644 --- a/packages/react/runtime/src/internal.ts +++ b/packages/react/runtime/src/internal.ts @@ -17,8 +17,6 @@ import { DynamicPartType } from './snapshot/dynamicPartType.js'; import { snapshotCreateList } from './snapshot/list.js'; import { SnapshotInstance, snapshotCreatorMap } from './snapshot/snapshot.js'; -export { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT } from './renderToOpcodes/constants.js'; - export { __page, __pageId, __root }; export { diff --git a/packages/react/runtime/vitest.config.ts b/packages/react/runtime/vitest.config.ts index 38178d3d1d..004d46a7d4 100644 --- a/packages/react/runtime/vitest.config.ts +++ b/packages/react/runtime/vitest.config.ts @@ -64,6 +64,7 @@ export default defineConfig({ '@lynx-js/react/compat': path.resolve(__dirname, './compat/index.js'), '@lynx-js/react/worklet-runtime/bindings': path.resolve(__dirname, './src/worklet-runtime/bindings/index.ts'), '@lynx-js/react/runtime-components': path.resolve(__dirname, '../components/src/index.ts'), + '@lynx-js/react/constants': path.resolve(__dirname, './src/constants.ts'), '@lynx-js/react/internal': path.resolve(__dirname, './src/internal.ts'), '@lynx-js/react/jsx-dev-runtime': path.resolve(__dirname, './jsx-dev-runtime/index.js'), '@lynx-js/react/jsx-runtime': path.resolve(__dirname, './jsx-runtime/index.js'), diff --git a/packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts b/packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts index fcfd47b724..cf8708930c 100644 --- a/packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts +++ b/packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts @@ -92,6 +92,7 @@ export const reactLynxExternalsPreset: Externals = { 'react': ['ReactLynx', 'React'], '@lynx-js/react': ['ReactLynx', 'React'], '@lynx-js/react/internal': ['ReactLynx', 'ReactInternal'], + '@lynx-js/react/constants': ['ReactLynx', 'ReactConstants'], '@lynx-js/react/jsx-dev-runtime': ['ReactLynx', 'ReactJSXDevRuntime'], '@lynx-js/react/jsx-runtime': ['ReactLynx', 'ReactJSXRuntime'], '@lynx-js/react/lepus/jsx-dev-runtime': [ diff --git a/packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts b/packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts index 8bd5e4a45d..c2a500d606 100644 --- a/packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts +++ b/packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts @@ -688,6 +688,7 @@ describe('pluginReactLynx', () => { "@lynx-js/preact-devtools$": false, "@lynx-js/react$": "/packages/react/runtime/lib/index.js", "@lynx-js/react/compat$": "/packages/react/runtime/compat/index.js", + "@lynx-js/react/constants$": "/packages/react/runtime/lib/constants.js", "@lynx-js/react/debug$": false, "@lynx-js/react/experimental/lazy/import$": "/packages/react/runtime/lazy/import.js", "@lynx-js/react/internal$": "/packages/react/runtime/lib/internal.js", diff --git a/packages/rspeedy/plugin-external-bundle/src/index.ts b/packages/rspeedy/plugin-external-bundle/src/index.ts index ff940f3922..e7abbd2e69 100644 --- a/packages/rspeedy/plugin-external-bundle/src/index.ts +++ b/packages/rspeedy/plugin-external-bundle/src/index.ts @@ -50,6 +50,12 @@ const reactLynxExternalTemplate = { mainThread: { sectionPath: 'ReactLynx__main-thread' }, async: false, }, + '@lynx-js/react/constants': { + libraryName: ['ReactLynx', 'ReactConstants'], + background: { sectionPath: 'ReactLynx' }, + mainThread: { sectionPath: 'ReactLynx__main-thread' }, + async: false, + }, '@lynx-js/react/jsx-dev-runtime': { libraryName: ['ReactLynx', 'ReactJSXDevRuntime'], background: { sectionPath: 'ReactLynx' }, diff --git a/packages/rspeedy/plugin-react-alias/src/index.ts b/packages/rspeedy/plugin-react-alias/src/index.ts index 86b9bb8e4e..cc8285fd2f 100644 --- a/packages/rspeedy/plugin-react-alias/src/index.ts +++ b/packages/rspeedy/plugin-react-alias/src/index.ts @@ -134,6 +134,7 @@ export function pluginReactAlias(options: Options): RsbuildPlugin { // 'debug', 'experimental/lazy/import', 'internal', + 'constants', 'legacy-react-runtime', 'runtime-components', 'worklet-runtime/bindings', diff --git a/packages/rspeedy/plugin-react-alias/test/index.test.ts b/packages/rspeedy/plugin-react-alias/test/index.test.ts index b573576ae3..a54e187c5a 100644 --- a/packages/rspeedy/plugin-react-alias/test/index.test.ts +++ b/packages/rspeedy/plugin-react-alias/test/index.test.ts @@ -40,6 +40,10 @@ describe('React - alias', () => { '@lynx-js/react/internal', ) + expect(config.resolve.alias).not.toHaveProperty( + '@lynx-js/react/constants', + ) + expect(config.resolve.alias).toHaveProperty( 'react$', expect.stringContaining( @@ -61,6 +65,13 @@ describe('React - alias', () => { ), ) + expect(config.resolve.alias).toHaveProperty( + '@lynx-js/react/constants$', + expect.stringContaining( + '/packages/react/runtime/lib/constants.js'.replaceAll('/', path.sep), + ), + ) + expect(config.resolve.alias).toHaveProperty( '@lynx-js/react/experimental/lazy/import$', expect.stringContaining( @@ -211,6 +222,10 @@ describe('React - alias', () => { '@lynx-js/react/internal', ) + expect(config.resolve.alias).not.toHaveProperty( + '@lynx-js/react/constants', + ) + expect(config.resolve.alias).toHaveProperty( 'react$', expect.stringContaining( @@ -232,6 +247,13 @@ describe('React - alias', () => { ), ) + expect(config.resolve.alias).toHaveProperty( + '@lynx-js/react/constants$', + expect.stringContaining( + '/packages/react/runtime/lib/constants.js'.replaceAll('/', path.sep), + ), + ) + expect(config.resolve.alias).toHaveProperty( '@lynx-js/react/debug$', false, @@ -339,6 +361,16 @@ describe('React - alias', () => { '/packages/react/runtime/lib/internal.js'.replaceAll('/', path.sep), ), ) + + expect(webConfig.resolve.alias).toHaveProperty( + '@lynx-js/react/constants$', + expect.stringContaining( + '/packages/react/runtime/lib/constants.js'.replaceAll( + '/', + path.sep, + ), + ), + ) }) test('alias with plugins + environments', async () => { diff --git a/packages/rspeedy/plugin-react/package.json b/packages/rspeedy/plugin-react/package.json index 9de644426c..287598ad1f 100644 --- a/packages/rspeedy/plugin-react/package.json +++ b/packages/rspeedy/plugin-react/package.json @@ -66,7 +66,7 @@ "typia-rspack-plugin": "2.2.2" }, "peerDependencies": { - "@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0 || ^0.116.0 || ^0.117.0 || ^0.118.0" + "@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0 || ^0.114.0 || ^0.115.0 || ^0.116.0 || ^0.117.0 || ^0.118.0 || ^0.119.0" }, "peerDependenciesMeta": { "@lynx-js/react": { diff --git a/packages/rspeedy/plugin-react/test/config.test.ts b/packages/rspeedy/plugin-react/test/config.test.ts index 9457fb4344..97e6512ad7 100644 --- a/packages/rspeedy/plugin-react/test/config.test.ts +++ b/packages/rspeedy/plugin-react/test/config.test.ts @@ -78,6 +78,10 @@ describe('Config', () => { '@lynx-js/react/internal', ) + expect(config.resolve.alias).not.toHaveProperty( + '@lynx-js/react/constants', + ) + expect(config.resolve.alias).toHaveProperty( '@lynx-js/react$', expect.stringContaining( @@ -284,6 +288,10 @@ describe('Config', () => { '@lynx-js/react/internal', ) + expect(config.resolve.alias).not.toHaveProperty( + '@lynx-js/react/constants', + ) + expect(config.resolve.alias).toHaveProperty( '@lynx-js/react$', expect.stringContaining( diff --git a/packages/rspeedy/plugin-react/test/lazy.test.ts b/packages/rspeedy/plugin-react/test/lazy.test.ts index 5d56733205..1cc0ece1c4 100644 --- a/packages/rspeedy/plugin-react/test/lazy.test.ts +++ b/packages/rspeedy/plugin-react/test/lazy.test.ts @@ -47,10 +47,17 @@ describe('Lazy', () => { expect(config?.resolve?.alias).not.toHaveProperty( '@lynx-js/react/internal', ) + expect(config?.resolve?.alias).not.toHaveProperty( + '@lynx-js/react/constants', + ) expect(config?.resolve?.alias).toHaveProperty( '@lynx-js/react/internal$', expect.stringContaining('lazy/internal'.replaceAll('/', path.sep)), ) + expect(config?.resolve?.alias).toHaveProperty( + '@lynx-js/react/constants$', + expect.stringContaining('lazy/constants'.replaceAll('/', path.sep)), + ) }) test('output.library', async () => { diff --git a/packages/webpack/react-webpack-plugin/test/cases/basic/lazy-imports/index.jsx b/packages/webpack/react-webpack-plugin/test/cases/basic/lazy-imports/index.jsx index 9dc215b755..856cfe2d9a 100644 --- a/packages/webpack/react-webpack-plugin/test/cases/basic/lazy-imports/index.jsx +++ b/packages/webpack/react-webpack-plugin/test/cases/basic/lazy-imports/index.jsx @@ -7,6 +7,9 @@ const sExportsReactLepus = Symbol.for( const sExportsReactInternal = Symbol.for( '__REACT_LYNX_EXPORTS__(@lynx-js/react/internal)', ); +const sExportsReactConstants = Symbol.for( + '__REACT_LYNX_EXPORTS__(@lynx-js/react/constants)', +); const sExportsJSXRuntime = Symbol.for( '__REACT_LYNX_EXPORTS__(@lynx-js/react/jsx-runtime)', ); @@ -24,6 +27,7 @@ it('should not have experimental/lazy/import imported', () => { expect(lynx[sExportsReact]).toBeUndefined(); expect(lynx[sExportsReactLepus]).toBeUndefined(); expect(lynx[sExportsReactInternal]).toBeUndefined(); + expect(lynx[sExportsReactConstants]).toBeUndefined(); expect(lynx[sExportsJSXRuntime]).toBeUndefined(); expect(lynx[sExportsJSXDevRuntime]).toBeUndefined(); expect(lynx[sExportsLegacyReactRuntime]).toBeUndefined(); @@ -31,6 +35,7 @@ it('should not have experimental/lazy/import imported', () => { expect(globalThis[sExportsReact]).toBeUndefined(); expect(globalThis[sExportsReactLepus]).toBeUndefined(); expect(globalThis[sExportsReactInternal]).toBeUndefined(); + expect(globalThis[sExportsReactConstants]).toBeUndefined(); expect(globalThis[sExportsJSXRuntime]).toBeUndefined(); expect(globalThis[sExportsJSXDevRuntime]).toBeUndefined(); expect(globalThis[sExportsLegacyReactRuntime]).toBeUndefined(); diff --git a/packages/webpack/react-webpack-plugin/test/cases/code-splitting/lazy-imports/index.jsx b/packages/webpack/react-webpack-plugin/test/cases/code-splitting/lazy-imports/index.jsx index f3c8f9ad29..6d4e287ea4 100644 --- a/packages/webpack/react-webpack-plugin/test/cases/code-splitting/lazy-imports/index.jsx +++ b/packages/webpack/react-webpack-plugin/test/cases/code-splitting/lazy-imports/index.jsx @@ -7,6 +7,9 @@ const sExportsReactLepus = Symbol.for( const sExportsReactInternal = Symbol.for( '__REACT_LYNX_EXPORTS__(@lynx-js/react/internal)', ); +const sExportsReactConstants = Symbol.for( + '__REACT_LYNX_EXPORTS__(@lynx-js/react/constants)', +); const sExportsJSXRuntime = Symbol.for( '__REACT_LYNX_EXPORTS__(@lynx-js/react/jsx-runtime)', ); @@ -30,6 +33,7 @@ it('should have experimental/lazy/import imported', async () => { expect(lynx[sExportsReact]).not.toBeUndefined(); expect(lynx[sExportsReactLepus]).not.toBeUndefined(); expect(lynx[sExportsReactInternal]).not.toBeUndefined(); + expect(lynx[sExportsReactConstants]).not.toBeUndefined(); expect(lynx[sExportsJSXRuntime]).not.toBeUndefined(); expect(lynx[sExportsJSXDevRuntime]).not.toBeUndefined(); expect(lynx[sExportsLegacyReactRuntime]).not.toBeUndefined(); @@ -37,6 +41,7 @@ it('should have experimental/lazy/import imported', async () => { expect(globalThis[sExportsReact]).not.toBeUndefined(); expect(globalThis[sExportsReactLepus]).not.toBeUndefined(); expect(globalThis[sExportsReactInternal]).not.toBeUndefined(); + expect(globalThis[sExportsReactConstants]).not.toBeUndefined(); expect(globalThis[sExportsJSXRuntime]).not.toBeUndefined(); expect(globalThis[sExportsJSXDevRuntime]).not.toBeUndefined(); expect(globalThis[sExportsLegacyReactRuntime]).not.toBeUndefined(); diff --git a/packages/webpack/react-webpack-plugin/test/cases/compat/component-is/index.jsx b/packages/webpack/react-webpack-plugin/test/cases/compat/component-is/index.jsx index 38e6ca9d31..15d1bca0e0 100644 --- a/packages/webpack/react-webpack-plugin/test/cases/compat/component-is/index.jsx +++ b/packages/webpack/react-webpack-plugin/test/cases/compat/component-is/index.jsx @@ -7,6 +7,9 @@ const sExportsReactLepus = Symbol.for( const sExportsReactInternal = Symbol.for( '__REACT_LYNX_EXPORTS__(@lynx-js/react/internal)', ); +const sExportsReactConstants = Symbol.for( + '__REACT_LYNX_EXPORTS__(@lynx-js/react/constants)', +); const sExportsJSXRuntime = Symbol.for( '__REACT_LYNX_EXPORTS__(@lynx-js/react/jsx-runtime)', ); @@ -26,6 +29,7 @@ it('should have experimental/lazy/import imported', () => { expect(lynx[sExportsReact]).not.toBeUndefined(); expect(lynx[sExportsReactLepus]).not.toBeUndefined(); expect(lynx[sExportsReactInternal]).not.toBeUndefined(); + expect(lynx[sExportsReactConstants]).not.toBeUndefined(); expect(lynx[sExportsJSXRuntime]).not.toBeUndefined(); expect(lynx[sExportsJSXDevRuntime]).not.toBeUndefined(); expect(lynx[sExportsLegacyReactRuntime]).not.toBeUndefined(); @@ -33,6 +37,7 @@ it('should have experimental/lazy/import imported', () => { expect(globalThis[sExportsReact]).not.toBeUndefined(); expect(globalThis[sExportsReactLepus]).not.toBeUndefined(); expect(globalThis[sExportsReactInternal]).not.toBeUndefined(); + expect(globalThis[sExportsReactConstants]).not.toBeUndefined(); expect(globalThis[sExportsJSXRuntime]).not.toBeUndefined(); expect(globalThis[sExportsJSXDevRuntime]).not.toBeUndefined(); expect(globalThis[sExportsLegacyReactRuntime]).not.toBeUndefined();