UNPKG

@nx/react

Version:

The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides: - Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook. - Generators for applica

47 lines (46 loc) 4.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.REACT_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.REACT_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.REACT_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.REACT_FEDERATE_MODULE_GENERATOR_DEPRECATION_MESSAGE = exports.REACT_REMOTE_GENERATOR_DEPRECATION_MESSAGE = exports.REACT_HOST_GENERATOR_DEPRECATION_MESSAGE = void 0; exports.warnReactHostGeneratorDeprecation = warnReactHostGeneratorDeprecation; exports.warnReactRemoteGeneratorDeprecation = warnReactRemoteGeneratorDeprecation; exports.warnReactFederateModuleGeneratorDeprecation = warnReactFederateModuleGeneratorDeprecation; exports.warnReactMfDevServerExecutorDeprecation = warnReactMfDevServerExecutorDeprecation; exports.warnReactMfSsrDevServerExecutorDeprecation = warnReactMfSsrDevServerExecutorDeprecation; exports.warnReactMfStaticServerExecutorDeprecation = warnReactMfStaticServerExecutorDeprecation; const devkit_1 = require("@nx/devkit"); // TODO(v24): Remove these surfaces. Replaced by `@nx/react:consumer` // and `@nx/react:provider` (React, dynamic federation, Vite/Rsbuild/Rspack). const MIGRATION_URL = 'https://nx.dev/docs/technologies/module-federation/consumer-and-provider'; exports.REACT_HOST_GENERATOR_DEPRECATION_MESSAGE = `The \`@nx/react:host\` generator is deprecated and will be removed in Nx v24. Use \`nx g @nx/react:consumer\` (dynamic federation, no static-serve orchestration). See ${MIGRATION_URL} for the v23 migration guide.`; exports.REACT_REMOTE_GENERATOR_DEPRECATION_MESSAGE = `The \`@nx/react:remote\` generator is deprecated and will be removed in Nx v24. Use \`nx g @nx/react:provider\` instead. See ${MIGRATION_URL} for the v23 migration guide.`; exports.REACT_FEDERATE_MODULE_GENERATOR_DEPRECATION_MESSAGE = `The \`@nx/react:federate-module\` generator is deprecated and will be removed in Nx v24. The new \`@nx/react:provider\` generator exposes modules directly. See ${MIGRATION_URL} for the v23 migration guide.`; exports.REACT_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/react:module-federation-dev-server\` executor is deprecated and will be removed in Nx v24. Dynamic federation in \`@nx/react:consumer\` removes the need for host-orchestrated remote serving. See ${MIGRATION_URL} for the v23 migration guide.`; exports.REACT_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/react:module-federation-ssr-dev-server\` executor is deprecated and will be removed in Nx v24. SSR is not first-classed in the new generators; see ${MIGRATION_URL} for guidance on wiring SSR with \`@nx/react:consumer\`.`; exports.REACT_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/react:module-federation-static-server\` executor is deprecated and will be removed in Nx v24. Use plain \`vite preview\` / \`rsbuild preview\` via \`nx:run-commands\` if a static-serve workflow is still needed. See ${MIGRATION_URL} for details.`; function warnReactHostGeneratorDeprecation() { devkit_1.logger.warn(exports.REACT_HOST_GENERATOR_DEPRECATION_MESSAGE); } function warnReactRemoteGeneratorDeprecation() { devkit_1.logger.warn(exports.REACT_REMOTE_GENERATOR_DEPRECATION_MESSAGE); } function warnReactFederateModuleGeneratorDeprecation() { devkit_1.logger.warn(exports.REACT_FEDERATE_MODULE_GENERATOR_DEPRECATION_MESSAGE); } // Executor warnings fire once per process (dev-server reload loops would // otherwise flood the console). const executorWarned = new Set(); function warnOnce(key, message) { if (executorWarned.has(key)) return; executorWarned.add(key); devkit_1.logger.warn(message); } function warnReactMfDevServerExecutorDeprecation() { warnOnce('react-mf-dev-server', exports.REACT_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE); } function warnReactMfSsrDevServerExecutorDeprecation() { warnOnce('react-mf-ssr-dev-server', exports.REACT_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE); } function warnReactMfStaticServerExecutorDeprecation() { warnOnce('react-mf-static-server', exports.REACT_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE); }