diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 3894a778092f..3c67dadc9db9 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -7,6 +7,9 @@ _Released 12/3/2024 (PENDING)_ - Removed support for Node.js 16 and Node.js 21. Addresses [#29930](https://github.com/cypress-io/cypress/issues/29930). - Prebuilt binaries for Linux are no longer compatible with Linux distributions based on glibc <2.28, for example: Ubuntu 14-18, RHEL 7, CentOS 7, Amazon Linux 2. Addresses [#29601](https://github.com/cypress-io/cypress/issues/29601). +- The + `experimentalJustInTimeCompile` + configuration option for component testing has been replaced with a `justInTimeCompile` option that is `true` by default. This option will only compile resources directly related to your spec, compiling them 'just-in-time' before spec execution. This should result in improved memory management and performance for component tests in `cypress open` and `cypress run` modes, in particular for large component testing suites. `justInTimeCompile` is now only supported for [`webpack`](https://www.npmjs.com/package/webpack). Addresses [#30234](https://github.com/cypress-io/cypress/issues/30234). Addressed in [#30402](https://github.com/cypress-io/cypress/pull/30402). - Cypress now only officially supports the latest 3 major versions of Chrome, Firefox, and Edge - older browser versions may still work, but we recommend keeping your browsers up to date to ensure compatibility with Cypress. A warning will no longer be displayed on browser selection in the Launchpad for any 'unsupported' browser versions. Additionally, the undocumented `minSupportedVersion` property has been removed from `Cypress.browser`. Addressed in [#30462](https://github.com/cypress-io/cypress/pull/30462). - The `delayMs` option of `cy.intercept()` has been removed. This option was deprecated in Cypress 6.4.0. Please use the `delay` option instead. Addressed in [#30463](https://github.com/cypress-io/cypress/pull/30463). - The `experimentalFetchPolyfill` configuration option was removed. This option was deprecated in Cypress 6.0.0. We recommend using `cy.intercept()` for handling fetch requests. Addressed in [#30466](https://github.com/cypress-io/cypress/pull/30466). diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 16064021ddcf..40282d4b756b 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -3113,14 +3113,6 @@ declare namespace Cypress { * @default null */ experimentalSkipDomainInjection: string[] | null - /** - * Allows for just-in-time compiling of a component test, which will only compile assets related to the component. - * This results in a smaller bundle under test, reducing resource constraints on a given machine. This option is recommended - * for users with large component testing projects and those who are running into webpack 'chunk load error' issues. - * Supported for vite and webpack. For component testing only. - * @see https://on.cypress.io/experiments#Configuration - */ - experimentalJustInTimeCompile: boolean /** * Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm. * @default false @@ -3147,6 +3139,14 @@ declare namespace Cypress { * To enable test retries only in runMode, set e.g. `{ openMode: null, runMode: 2 }` * @default null */ + /** + * Allows for just-in-time compiling of a component test, which will only compile assets related to the component. + * This results in a smaller bundle under test, reducing resource constraints on a given machine. This option is recommended + * for users with large component testing projects and those who are running into webpack 'chunk load error' issues. + * Supported only for webpack. For component testing only. + * @see https://on.cypress.io/experiments#Configuration + */ + justInTimeCompile: boolean retries: Nullable, openMode?: Nullable }) | RetryStrategyWithModeSpecs> /** * Enables including elements within the shadow DOM when using querying diff --git a/npm/vite-dev-server/src/resolveConfig.ts b/npm/vite-dev-server/src/resolveConfig.ts index 10dfd5259290..3246326d0603 100644 --- a/npm/vite-dev-server/src/resolveConfig.ts +++ b/npm/vite-dev-server/src/resolveConfig.ts @@ -65,7 +65,7 @@ export const createViteDevServerConfig = async (config: ViteDevServerConfig, vit function makeCypressViteConfig (config: ViteDevServerConfig, vite: Vite): InlineConfig | InlineConfig { const { cypressConfig: { - experimentalJustInTimeCompile, + justInTimeCompile, port, projectRoot, devServerPublicPathRoute, @@ -129,8 +129,8 @@ function makeCypressViteConfig (config: ViteDevServerConfig, vite: Vite): Inline port: vitePort, host: '127.0.0.1', // Disable file watching and HMR when executing tests in `run` mode - // if experimentalJustInTimeCompile is configured, we need to watch for file changes as the spec entries are going to be updated per test in run mode - ...(isTextTerminal && !experimentalJustInTimeCompile + // if justInTimeCompile is configured, we need to watch for file changes as the spec entries are going to be updated per test in run mode + ...(isTextTerminal && !justInTimeCompile ? { watch: { ignored: '**/*' }, hmr: false } : {}), }, diff --git a/npm/vite-dev-server/test/resolveConfig.spec.ts b/npm/vite-dev-server/test/resolveConfig.spec.ts index 0963a5ccd95e..d0018d59975d 100644 --- a/npm/vite-dev-server/test/resolveConfig.spec.ts +++ b/npm/vite-dev-server/test/resolveConfig.spec.ts @@ -110,14 +110,14 @@ describe('resolveConfig', function () { }) }) - describe('experimentalJustInTimeCompile', () => { + describe('justInTimeCompile', () => { let viteDevServerConfig: ViteDevServerConfig beforeEach(async () => { const projectRoot = await scaffoldSystemTestProject(`vite${version}-inspect`) viteDevServerConfig = getViteDevServerConfig(projectRoot) - viteDevServerConfig.cypressConfig.experimentalJustInTimeCompile = true + viteDevServerConfig.cypressConfig.justInTimeCompile = true }) describe('open mode', () => { diff --git a/npm/webpack-dev-server/src/makeDefaultWebpackConfig.ts b/npm/webpack-dev-server/src/makeDefaultWebpackConfig.ts index 30bed4e005e8..61574d0d1c6f 100644 --- a/npm/webpack-dev-server/src/makeDefaultWebpackConfig.ts +++ b/npm/webpack-dev-server/src/makeDefaultWebpackConfig.ts @@ -17,7 +17,7 @@ export function makeCypressWebpackConfig ( const { devServerConfig: { cypressConfig: { - experimentalJustInTimeCompile, + justInTimeCompile, port, projectRoot, devServerPublicPathRoute, @@ -100,8 +100,8 @@ export function makeCypressWebpackConfig ( } as any if (isRunMode) { - // if experimentalJustInTimeCompile is configured, we need to watch for file changes as the spec entries are going to be updated per test - const ignored = experimentalJustInTimeCompile ? /node_modules/ : '**/*' + // if justInTimeCompile is configured, we need to watch for file changes as the spec entries are going to be updated per test + const ignored = justInTimeCompile ? /node_modules/ : '**/*' // Disable file watching when executing tests in `run` mode finalConfig.watchOptions = { diff --git a/npm/webpack-dev-server/test/makeWebpackConfig.spec.ts b/npm/webpack-dev-server/test/makeWebpackConfig.spec.ts index bd26bfa38659..0e232c52d161 100644 --- a/npm/webpack-dev-server/test/makeWebpackConfig.spec.ts +++ b/npm/webpack-dev-server/test/makeWebpackConfig.spec.ts @@ -392,7 +392,7 @@ describe('makeWebpackConfig', () => { }) }) - describe('experimentalJustInTimeCompile', () => { + describe('justInTimeCompile', () => { let devServerConfig: WebpackDevServerConfig const WEBPACK_MATRIX: { @@ -419,7 +419,7 @@ describe('makeWebpackConfig', () => { cypressConfig: { projectRoot: '.', devServerPublicPathRoute: '/test-public-path', - experimentalJustInTimeCompile: true, + justInTimeCompile: true, baseUrl: null, } as Cypress.PluginConfigOptions, webpackConfig: { diff --git a/packages/app/cypress/e2e/runner/runner-ct.experimentalJustInTimeCompile.cy.ts b/packages/app/cypress/e2e/runner/runner-ct.experimentalJustInTimeCompile.cy.ts index c3223f5e0baf..ca9fd5f8f9d2 100644 --- a/packages/app/cypress/e2e/runner/runner-ct.experimentalJustInTimeCompile.cy.ts +++ b/packages/app/cypress/e2e/runner/runner-ct.experimentalJustInTimeCompile.cy.ts @@ -2,7 +2,7 @@ import type { fixtureDirs } from '@tooling/system-tests' type ProjectDirs = typeof fixtureDirs -const EXPERIMENTAL_JIT_DIR: ProjectDirs[number] = 'experimental-JIT' +const JIT_COMPILE_DIR: ProjectDirs[number] = 'justInTimeCompile' const PROJECTS: {bundler: 'vite' | 'webpack'}[] = [ { bundler: 'vite' }, @@ -10,9 +10,9 @@ const PROJECTS: {bundler: 'vite' | 'webpack'}[] = [ ] for (const { bundler } of PROJECTS) { - const PROJECT_NAME = `${EXPERIMENTAL_JIT_DIR}/${bundler}` + const PROJECT_NAME = `${JIT_COMPILE_DIR}/${bundler}` - describe(`CT experimentalJustInTimeCompile: ${bundler}`, { viewportWidth: 1500, defaultCommandTimeout: 30000 }, () => { + describe(`CT justInTimeCompile: ${bundler}`, { viewportWidth: 1500, defaultCommandTimeout: 30000 }, () => { const visitComponentSpecAndVerifyPass = (specNumber: number) => { cy.contains(`Component-${specNumber}.cy.jsx`).click() cy.waitForSpecToFinish(undefined) diff --git a/packages/app/src/runner/index.ts b/packages/app/src/runner/index.ts index b150604e09bd..7e360f1535be 100644 --- a/packages/app/src/runner/index.ts +++ b/packages/app/src/runner/index.ts @@ -445,8 +445,8 @@ async function executeSpec (spec: SpecFile, isRerun: boolean = false) { } if (window.__CYPRESS_TESTING_TYPE__ === 'component') { - if (config.experimentalJustInTimeCompile && !config.isTextTerminal) { - // If running with experimentalJustInTimeCompile enabled and in open mode, + if (config.justInTimeCompile && !config.isTextTerminal) { + // If running with justInTimeCompile enabled and in open mode, // send a signal to the dev server to load the spec before running // since the spec and related resources are not yet compiled. await updateDevServerWithSpec(spec) diff --git a/packages/config/__snapshots__/index.spec.ts.js b/packages/config/__snapshots__/index.spec.ts.js index 9d6ca3731f71..904aa33fa569 100644 --- a/packages/config/__snapshots__/index.spec.ts.js +++ b/packages/config/__snapshots__/index.spec.ts.js @@ -39,7 +39,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1 'experimentalMemoryManagement': false, 'experimentalModifyObstructiveThirdPartyCode': false, 'experimentalSkipDomainInjection': null, - 'experimentalJustInTimeCompile': false, 'experimentalOriginDependencies': false, 'experimentalSourceRewriting': false, 'experimentalSingleTabRunMode': false, @@ -49,6 +48,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1 'fixturesFolder': 'cypress/fixtures', 'excludeSpecPattern': '*.hot-update.js', 'includeShadowDom': false, + 'justInTimeCompile': true, 'keystrokeDelay': 0, 'modifyObstructiveCode': true, 'numTestsKeptInMemory': 50, @@ -129,7 +129,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys f 'experimentalMemoryManagement': false, 'experimentalModifyObstructiveThirdPartyCode': false, 'experimentalSkipDomainInjection': null, - 'experimentalJustInTimeCompile': false, 'experimentalOriginDependencies': false, 'experimentalSourceRewriting': false, 'experimentalSingleTabRunMode': false, @@ -139,6 +138,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys f 'fixturesFolder': 'cypress/fixtures', 'excludeSpecPattern': '*.hot-update.js', 'includeShadowDom': false, + 'justInTimeCompile': false, 'keystrokeDelay': 0, 'modifyObstructiveCode': true, 'numTestsKeptInMemory': 50, @@ -215,7 +215,6 @@ exports['config/src/index .getPublicConfigKeys returns list of public config key 'experimentalMemoryManagement', 'experimentalModifyObstructiveThirdPartyCode', 'experimentalSkipDomainInjection', - 'experimentalJustInTimeCompile', 'experimentalOriginDependencies', 'experimentalSourceRewriting', 'experimentalSingleTabRunMode', @@ -225,6 +224,7 @@ exports['config/src/index .getPublicConfigKeys returns list of public config key 'fixturesFolder', 'excludeSpecPattern', 'includeShadowDom', + 'justInTimeCompile', 'keystrokeDelay', 'modifyObstructiveCode', 'numTestsKeptInMemory', diff --git a/packages/config/src/options.ts b/packages/config/src/options.ts index c9e4d9e7702d..e8499d5e6b5a 100644 --- a/packages/config/src/options.ts +++ b/packages/config/src/options.ts @@ -17,6 +17,7 @@ const BREAKING_OPTION_ERROR_KEY: Readonly = [ 'CONFIG_FILE_INVALID_TESTING_TYPE_CONFIG_COMPONENT', 'CONFIG_FILE_INVALID_TESTING_TYPE_CONFIG_E2E', 'EXPERIMENTAL_COMPONENT_TESTING_REMOVED', + 'EXPERIMENTAL_JIT_COMPILE_REMOVED', 'EXPERIMENTAL_SAMESITE_REMOVED', 'EXPERIMENTAL_NETWORK_STUBBING_REMOVED', 'EXPERIMENTAL_RUN_EVENTS_REMOVED', @@ -232,8 +233,8 @@ const driverConfigOptions: Array = [ isExperimental: true, requireRestartOnChange: 'server', }, { - name: 'experimentalJustInTimeCompile', - defaultValue: false, + name: 'justInTimeCompile', + defaultValue: true, validation: validate.isBoolean, isExperimental: true, requireRestartOnChange: 'server', @@ -631,6 +632,10 @@ export const breakingOptions: Readonly = [ name: 'experimentalGetCookiesSameSite', errorKey: 'EXPERIMENTAL_SAMESITE_REMOVED', isWarning: true, + }, { + name: 'experimentalJustInTimeCompile', + errorKey: 'EXPERIMENTAL_JIT_COMPILE_REMOVED', + isWarning: true, }, { name: 'experimentalNetworkStubbing', errorKey: 'EXPERIMENTAL_NETWORK_STUBBING_REMOVED', @@ -736,8 +741,8 @@ export const breakingRootOptions: Array = [ testingTypes: ['e2e'], }, { - name: 'experimentalJustInTimeCompile', - errorKey: 'EXPERIMENTAL_JIT_COMPONENT_TESTING', + name: 'justInTimeCompile', + errorKey: 'JIT_COMPONENT_TESTING', isWarning: false, testingTypes: ['component'], }, @@ -756,8 +761,8 @@ export const testingTypeBreakingOptions: { e2e: Array, component isWarning: false, }, { - name: 'experimentalJustInTimeCompile', - errorKey: 'EXPERIMENTAL_JIT_COMPONENT_TESTING', + name: 'justInTimeCompile', + errorKey: 'JIT_COMPONENT_TESTING', isWarning: false, }, ], diff --git a/packages/config/test/project/utils.spec.ts b/packages/config/test/project/utils.spec.ts index ffa0f49001b0..028de41aa920 100644 --- a/packages/config/test/project/utils.spec.ts +++ b/packages/config/test/project/utils.spec.ts @@ -969,6 +969,16 @@ describe('config/src/project/utils', () => { expect(warning).to.be.calledWith('EXPERIMENTAL_SAMESITE_REMOVED') }) + it('warns if experimentalJustInTimeCompile is passed', async function () { + const warning = sinon.spy(errors, 'warning') + + await this.defaults('experimentalJustInTimeCompile', true, { + experimentalJustInTimeCompile: true, + }) + + expect(warning).to.be.calledWith('EXPERIMENTAL_JIT_COMPILE_REMOVED') + }) + it('warns if experimentalSessionSupport is passed', async function () { const warning = sinon.spy(errors, 'warning') @@ -1056,11 +1066,11 @@ describe('config/src/project/utils', () => { clientCertificates: { value: [], from: 'default' }, defaultCommandTimeout: { value: 4000, from: 'default' }, downloadsFolder: { value: 'cypress/downloads', from: 'default' }, + excludeSpecPattern: { value: '*.hot-update.js', from: 'default' }, env: {}, execTimeout: { value: 60000, from: 'default' }, experimentalModifyObstructiveThirdPartyCode: { value: false, from: 'default' }, experimentalSkipDomainInjection: { value: null, from: 'default' }, - experimentalJustInTimeCompile: { value: false, from: 'default' }, experimentalCspAllowList: { value: false, from: 'default' }, experimentalInteractiveRunEvents: { value: false, from: 'default' }, experimentalMemoryManagement: { value: false, from: 'default' }, @@ -1073,7 +1083,7 @@ describe('config/src/project/utils', () => { fileServerFolder: { value: '', from: 'default' }, fixturesFolder: { value: 'cypress/fixtures', from: 'default' }, hosts: { value: null, from: 'default' }, - excludeSpecPattern: { value: '*.hot-update.js', from: 'default' }, + justInTimeCompile: { value: true, from: 'default' }, includeShadowDom: { value: false, from: 'default' }, isInteractive: { value: true, from: 'default' }, keystrokeDelay: { value: 0, from: 'default' }, @@ -1153,10 +1163,10 @@ describe('config/src/project/utils', () => { clientCertificates: { value: [], from: 'default' }, defaultCommandTimeout: { value: 4000, from: 'default' }, downloadsFolder: { value: 'cypress/downloads', from: 'default' }, + excludeSpecPattern: { value: '*.hot-update.js', from: 'default' }, execTimeout: { value: 60000, from: 'default' }, experimentalModifyObstructiveThirdPartyCode: { value: false, from: 'default' }, experimentalSkipDomainInjection: { value: null, from: 'default' }, - experimentalJustInTimeCompile: { value: false, from: 'default' }, experimentalCspAllowList: { value: false, from: 'default' }, experimentalInteractiveRunEvents: { value: false, from: 'default' }, experimentalMemoryManagement: { value: false, from: 'default' }, @@ -1191,7 +1201,7 @@ describe('config/src/project/utils', () => { fileServerFolder: { value: '', from: 'default' }, fixturesFolder: { value: 'cypress/fixtures', from: 'default' }, hosts: { value: null, from: 'default' }, - excludeSpecPattern: { value: '*.hot-update.js', from: 'default' }, + justInTimeCompile: { value: true, from: 'default' }, includeShadowDom: { value: false, from: 'default' }, isInteractive: { value: true, from: 'default' }, keystrokeDelay: { value: 0, from: 'default' }, diff --git a/packages/data-context/src/data/ProjectLifecycleManager.ts b/packages/data-context/src/data/ProjectLifecycleManager.ts index c46d10b5161d..a5d733de6f61 100644 --- a/packages/data-context/src/data/ProjectLifecycleManager.ts +++ b/packages/data-context/src/data/ProjectLifecycleManager.ts @@ -241,11 +241,11 @@ export class ProjectLifecycleManager { /** * We need to start the dev server in the ProjectLifecycleManager when: * 1. GA component testing is running so we can compile the dev server will all specs matching the specPattern - * 2. experimentalJustInTimeCompile is enabled. In this case, we start a dev server + * 2. justInTimeCompile is enabled. In this case, we start a dev server * with an empty specs list to initially compile the support file and related dependencies in order to hopefully * leverage the dev server cache for recompiling for when we actually have a spec to add to the dev server entry. */ - const specsToStartDevServer = finalConfig.experimentalJustInTimeCompile ? [] : this.ctx.project.specs + const specsToStartDevServer = finalConfig.justInTimeCompile ? [] : this.ctx.project.specs const devServerOptions = await this.ctx._apis.projectApi.getDevServer().start({ specs: specsToStartDevServer, config: finalConfig }) // If we received a cypressConfig.port we want to null it out diff --git a/packages/data-context/src/sources/ProjectDataSource.ts b/packages/data-context/src/sources/ProjectDataSource.ts index ca7088f2ffcd..dcd539365495 100644 --- a/packages/data-context/src/sources/ProjectDataSource.ts +++ b/packages/data-context/src/sources/ProjectDataSource.ts @@ -385,9 +385,9 @@ export class ProjectDataSource { try { const config = await this.ctx.project.getConfig() - // If running the experimentalJustInTimeCompile for CT, + // If running the justInTimeCompile for CT, // ignore this watcher since we only handle one spec at a time and do not need to recompile any time the file system changes. - if (config.experimentalJustInTimeCompile && testingType === 'component') { + if (config.justInTimeCompile && testingType === 'component') { this.ctx.actions.project.refreshSpecs(specs) // If no differences are found, we do not need to emit events @@ -395,7 +395,7 @@ export class ProjectDataSource { } } catch (e) { // for cy-in-cy tests the config is the second instance of cypress isn't considered initialized yet. - // in this case since we only need it for experimental JIT in open mode, swallow the error + // in this case since we only need it for JITCompile in open mode, swallow the error } if (_.isEqual(this.specs, specs)) { diff --git a/packages/errors/__snapshot-html__/EXPERIMENTAL_JIT_COMPILE_REMOVED.html b/packages/errors/__snapshot-html__/EXPERIMENTAL_JIT_COMPILE_REMOVED.html new file mode 100644 index 000000000000..80c9592d718d --- /dev/null +++ b/packages/errors/__snapshot-html__/EXPERIMENTAL_JIT_COMPILE_REMOVED.html @@ -0,0 +1,42 @@ + + + + + + + + + + + +
The experimentalJustInTimeCompile configuration option was removed in Cypress version 14.0.0.
+
+A new justInTimeCompile configuration option is available and is now true by default.
+
+You can safely remove this option from your config.
+
\ No newline at end of file diff --git a/packages/errors/__snapshot-html__/EXPERIMENTAL_JIT_COMPONENT_TESTING.html b/packages/errors/__snapshot-html__/JIT_COMPONENT_TESTING.html similarity index 68% rename from packages/errors/__snapshot-html__/EXPERIMENTAL_JIT_COMPONENT_TESTING.html rename to packages/errors/__snapshot-html__/JIT_COMPONENT_TESTING.html index e7ed5e722e49..d503011487dc 100644 --- a/packages/errors/__snapshot-html__/EXPERIMENTAL_JIT_COMPONENT_TESTING.html +++ b/packages/errors/__snapshot-html__/JIT_COMPONENT_TESTING.html @@ -34,7 +34,5 @@ -
The experimentalJustInTimeCompile experiment is currently only supported for Component Testing.
-
-If you have feedback about the experiment, please join the discussion here: http://on.cypress.io/just-in-time-compile
+    
The justInTimeCompile configuration is only supported for Component Testing.
 
\ No newline at end of file diff --git a/packages/errors/src/errors.ts b/packages/errors/src/errors.ts index 79dd5f6422c4..712580387e7d 100644 --- a/packages/errors/src/errors.ts +++ b/packages/errors/src/errors.ts @@ -1239,6 +1239,14 @@ export const AllCypressErrors = { You can safely remove this option from your config.` }, + EXPERIMENTAL_JIT_COMPILE_REMOVED: () => { + return errTemplate`\ + The ${fmt.highlight(`experimentalJustInTimeCompile`)} configuration option was removed in ${fmt.cypressVersion(`14.0.0`)}. + + A new ${fmt.highlightSecondary(`justInTimeCompile`)} configuration option is available and is now ${fmt.highlightSecondary(`true`)} by default. + + You can safely remove this option from your config.` + }, // TODO: verify configFile is absolute path // TODO: make this relative path, not absolute EXPERIMENTAL_COMPONENT_TESTING_REMOVED: (arg1: {configFile: string}) => { @@ -1338,11 +1346,9 @@ export const AllCypressErrors = { ${fmt.code(code)}` }, - EXPERIMENTAL_JIT_COMPONENT_TESTING: () => { + JIT_COMPONENT_TESTING: () => { return errTemplate`\ - The ${fmt.highlight(`experimentalJustInTimeCompile`)} experiment is currently only supported for Component Testing. - - If you have feedback about the experiment, please join the discussion here: http://on.cypress.io/just-in-time-compile` + The ${fmt.highlight(`justInTimeCompile`)} configuration is only supported for Component Testing.` }, EXPERIMENTAL_USE_DEFAULT_DOCUMENT_DOMAIN_E2E_ONLY: () => { const code = errPartial` diff --git a/packages/errors/test/unit/visualSnapshotErrors_spec.ts b/packages/errors/test/unit/visualSnapshotErrors_spec.ts index 9c3a912dadc9..d8bb963e9dd9 100644 --- a/packages/errors/test/unit/visualSnapshotErrors_spec.ts +++ b/packages/errors/test/unit/visualSnapshotErrors_spec.ts @@ -1151,6 +1151,11 @@ describe('visual error templates', () => { default: [], } }, + EXPERIMENTAL_JIT_COMPILE_REMOVED: () => { + return { + default: [], + } + }, EXPERIMENTAL_COMPONENT_TESTING_REMOVED: () => { return { default: [{ configFile: '/path/to/cypress.config.js' }], @@ -1277,7 +1282,7 @@ describe('visual error templates', () => { default: [{ name: 'indexHtmlFile', configFile: '/path/to/cypress.config.js.ts' }], } }, - EXPERIMENTAL_JIT_COMPONENT_TESTING: () => { + JIT_COMPONENT_TESTING: () => { return { default: [], } diff --git a/packages/frontend-shared/src/locales/en-US.json b/packages/frontend-shared/src/locales/en-US.json index 6f384698bf44..446e788f9293 100644 --- a/packages/frontend-shared/src/locales/en-US.json +++ b/packages/frontend-shared/src/locales/en-US.json @@ -605,10 +605,6 @@ "name": "Single tab run mode", "description": "Runs all component specs in a single tab, trading spec isolation for faster run mode execution." }, - "experimentalJustInTimeCompile": { - "name": "Just-In-Time compiling", - "description": "Enables Just-In-Time (JIT) compiling for component testing, which will only compile assets related to the spec before the spec is run. Currently supported for Vite and Webpack." - }, "experimentalSourceRewriting": { "name": "Source rewriting", "description": "Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm. See [#5273](https://github.com/cypress-io/cypress/issues/5273) for details." diff --git a/packages/graphql/schemas/schema.graphql b/packages/graphql/schemas/schema.graphql index d5981ae96608..1fd4a0f51b03 100644 --- a/packages/graphql/schemas/schema.graphql +++ b/packages/graphql/schemas/schema.graphql @@ -1186,12 +1186,12 @@ enum ErrorTypeEnum { ERROR_READING_FILE ERROR_WRITING_FILE EXPERIMENTAL_COMPONENT_TESTING_REMOVED - EXPERIMENTAL_JIT_COMPONENT_TESTING EXPERIMENTAL_NETWORK_STUBBING_REMOVED EXPERIMENTAL_ORIGIN_DEPENDENCIES_E2E_ONLY EXPERIMENTAL_RUN_ALL_SPECS_E2E_ONLY EXPERIMENTAL_RUN_EVENTS_REMOVED EXPERIMENTAL_SAMESITE_REMOVED + EXPERIMENTAL_JIT_COMPILE_REMOVED EXPERIMENTAL_SESSION_AND_ORIGIN_REMOVED EXPERIMENTAL_SESSION_SUPPORT_REMOVED EXPERIMENTAL_SHADOW_DOM_REMOVED @@ -1219,6 +1219,7 @@ enum ErrorTypeEnum { INVALID_CYPRESS_INTERNAL_ENV INVALID_REPORTER_NAME INVOKED_BINARY_OUTSIDE_NPM_MODULE + JIT_COMPONENT_TESTING LEGACY_CONFIG_ERROR_DURING_MIGRATION LEGACY_CONFIG_FILE MIGRATION_ALREADY_OCURRED diff --git a/packages/server/lib/experiments.ts b/packages/server/lib/experiments.ts index f8607a07f7a6..27d2274c9fdf 100644 --- a/packages/server/lib/experiments.ts +++ b/packages/server/lib/experiments.ts @@ -52,7 +52,6 @@ interface StringValues { */ const _summaries: StringValues = { experimentalInteractiveRunEvents: 'Allows listening to the `before:run`, `after:run`, `before:spec`, and `after:spec` events in the plugins file during interactive mode.', - experimentalJustInTimeCompile: 'Just-In-Time compiling', experimentalModifyObstructiveThirdPartyCode: 'Applies `modifyObstructiveCode` to third party `.html` and `.js`, removes subresource integrity, and modifies the user agent in Electron.', experimentalSkipDomainInjection: 'Disables setting document.domain to the document\'s super domain on injection.', experimentalSourceRewriting: 'Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm.', @@ -76,7 +75,6 @@ const _summaries: StringValues = { */ const _names: StringValues = { experimentalInteractiveRunEvents: 'Interactive Mode Run Events', - experimentalJustInTimeCompile: 'Enables Just-In-Time (JIT) compiling for component testing, which will only compile assets related to the spec before the spec is run. Currently supported for Vite and Webpack.', experimentalModifyObstructiveThirdPartyCode: 'Modify Obstructive Third Party Code', experimentalSkipDomainInjection: 'Use Default document.domain', experimentalSingleTabRunMode: 'Single Tab Run Mode', diff --git a/packages/server/lib/modes/run.ts b/packages/server/lib/modes/run.ts index db70e790eb7a..6300eae77d46 100644 --- a/packages/server/lib/modes/run.ts +++ b/packages/server/lib/modes/run.ts @@ -421,7 +421,7 @@ async function listenForProjectEnd (project: ProjectBase, exit: boolean): Promis project.once('end', (results) => { debug('project ended with results %O', results) // If the project ends and the spec is skipped, treat the run as cancelled - // as we do not want to update the dev server unnecessarily for experimentalJustInTimeCompile. + // as we do not want to update the dev server unnecessarily for justInTimeCompile. if (results?.skippedSpec) { isRunCancelled = true } @@ -814,13 +814,13 @@ async function runSpecs (options: { config: Cfg, browser: Browser, sys: any, hea printResults.displaySpecHeader(spec.relativeToCommonRoot, index + 1, length, estimated) } - const isExperimentalJustInTimeCompile = options.testingType === 'component' && config.experimentalJustInTimeCompile + const isJustInTimeCompile = options.testingType === 'component' && config.justInTimeCompile // Only update the dev server if the run is not cancelled - if (isExperimentalJustInTimeCompile) { + if (isJustInTimeCompile) { if (isRunCancelled) { // TODO: this logic to skip updating the dev-server on cancel needs a system-test before the feature goes generally available. - debug(`isExperimentalJustInTimeCompile=true and run is cancelled. Not updating dev server with spec ${spec.absolute}.`) + debug(`isJustInTimeCompile=true and run is cancelled. Not updating dev server with spec ${spec.absolute}.`) } else { const ctx = require('@packages/data-context').getCtx() diff --git a/packages/types/src/config.ts b/packages/types/src/config.ts index d2498d982634..2f886303facd 100644 --- a/packages/types/src/config.ts +++ b/packages/types/src/config.ts @@ -30,7 +30,7 @@ export interface FullConfig extends Partial - & Pick // TODO: Figure out how to type this better. + & Pick // TODO: Figure out how to type this better. export interface SettingsOptions { testingType?: 'component' |'e2e' diff --git a/system-tests/__snapshots__/results_spec.ts.js b/system-tests/__snapshots__/results_spec.ts.js index 5945b4bff6e8..1b948a5e51fc 100644 --- a/system-tests/__snapshots__/results_spec.ts.js +++ b/system-tests/__snapshots__/results_spec.ts.js @@ -26,7 +26,6 @@ exports['module api and after:run results'] = ` "experimentalMemoryManagement": false, "experimentalModifyObstructiveThirdPartyCode": false, "experimentalSkipDomainInjection": null, - "experimentalJustInTimeCompile": false, "experimentalOriginDependencies": false, "experimentalSourceRewriting": false, "experimentalSingleTabRunMode": false, @@ -36,6 +35,7 @@ exports['module api and after:run results'] = ` "fixturesFolder": "/path/to/fixturesFolder", "excludeSpecPattern": "*.hot-update.js", "includeShadowDom": false, + "justInTimeCompile": true, "keystrokeDelay": 0, "modifyObstructiveCode": true, "numTestsKeptInMemory": 0, diff --git a/system-tests/projects/experimental-JIT/vite/cypress.config.js b/system-tests/projects/justInTimeCompile/vite/cypress.config.js similarity index 73% rename from system-tests/projects/experimental-JIT/vite/cypress.config.js rename to system-tests/projects/justInTimeCompile/vite/cypress.config.js index ce96c524dc61..d7ec8a385d17 100644 --- a/system-tests/projects/experimental-JIT/vite/cypress.config.js +++ b/system-tests/projects/justInTimeCompile/vite/cypress.config.js @@ -1,6 +1,5 @@ module.exports = { component: { - experimentalJustInTimeCompile: true, devServer: { framework: 'react', bundler: 'vite', diff --git a/system-tests/projects/experimental-JIT/vite/cypress/support/component-index.html b/system-tests/projects/justInTimeCompile/vite/cypress/support/component-index.html similarity index 100% rename from system-tests/projects/experimental-JIT/vite/cypress/support/component-index.html rename to system-tests/projects/justInTimeCompile/vite/cypress/support/component-index.html diff --git a/system-tests/projects/experimental-JIT/vite/cypress/support/component.js b/system-tests/projects/justInTimeCompile/vite/cypress/support/component.js similarity index 100% rename from system-tests/projects/experimental-JIT/vite/cypress/support/component.js rename to system-tests/projects/justInTimeCompile/vite/cypress/support/component.js diff --git a/system-tests/projects/experimental-JIT/vite/package.json b/system-tests/projects/justInTimeCompile/vite/package.json similarity index 100% rename from system-tests/projects/experimental-JIT/vite/package.json rename to system-tests/projects/justInTimeCompile/vite/package.json diff --git a/system-tests/projects/experimental-JIT/vite/src/Component-1.cy.jsx b/system-tests/projects/justInTimeCompile/vite/src/Component-1.cy.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/vite/src/Component-1.cy.jsx rename to system-tests/projects/justInTimeCompile/vite/src/Component-1.cy.jsx diff --git a/system-tests/projects/experimental-JIT/vite/src/Component-1.jsx b/system-tests/projects/justInTimeCompile/vite/src/Component-1.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/vite/src/Component-1.jsx rename to system-tests/projects/justInTimeCompile/vite/src/Component-1.jsx diff --git a/system-tests/projects/experimental-JIT/vite/src/Component-2.cy.jsx b/system-tests/projects/justInTimeCompile/vite/src/Component-2.cy.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/vite/src/Component-2.cy.jsx rename to system-tests/projects/justInTimeCompile/vite/src/Component-2.cy.jsx diff --git a/system-tests/projects/experimental-JIT/vite/src/Component-2.jsx b/system-tests/projects/justInTimeCompile/vite/src/Component-2.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/vite/src/Component-2.jsx rename to system-tests/projects/justInTimeCompile/vite/src/Component-2.jsx diff --git a/system-tests/projects/experimental-JIT/vite/src/Component-3.cy.jsx b/system-tests/projects/justInTimeCompile/vite/src/Component-3.cy.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/vite/src/Component-3.cy.jsx rename to system-tests/projects/justInTimeCompile/vite/src/Component-3.cy.jsx diff --git a/system-tests/projects/experimental-JIT/vite/src/Component-3.jsx b/system-tests/projects/justInTimeCompile/vite/src/Component-3.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/vite/src/Component-3.jsx rename to system-tests/projects/justInTimeCompile/vite/src/Component-3.jsx diff --git a/system-tests/projects/experimental-JIT/vite/vite.config.js b/system-tests/projects/justInTimeCompile/vite/vite.config.js similarity index 100% rename from system-tests/projects/experimental-JIT/vite/vite.config.js rename to system-tests/projects/justInTimeCompile/vite/vite.config.js diff --git a/system-tests/projects/experimental-JIT/vite/yarn.lock b/system-tests/projects/justInTimeCompile/vite/yarn.lock similarity index 100% rename from system-tests/projects/experimental-JIT/vite/yarn.lock rename to system-tests/projects/justInTimeCompile/vite/yarn.lock diff --git a/system-tests/projects/experimental-JIT/webpack/README.md b/system-tests/projects/justInTimeCompile/webpack/README.md similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/README.md rename to system-tests/projects/justInTimeCompile/webpack/README.md diff --git a/system-tests/projects/experimental-JIT/webpack/cypress.config.js b/system-tests/projects/justInTimeCompile/webpack/cypress.config.js similarity index 74% rename from system-tests/projects/experimental-JIT/webpack/cypress.config.js rename to system-tests/projects/justInTimeCompile/webpack/cypress.config.js index 1e564e2aab2c..1a67568a6e9e 100644 --- a/system-tests/projects/experimental-JIT/webpack/cypress.config.js +++ b/system-tests/projects/justInTimeCompile/webpack/cypress.config.js @@ -1,6 +1,5 @@ module.exports = { component: { - experimentalJustInTimeCompile: true, devServer: { framework: 'react', bundler: 'webpack', diff --git a/system-tests/projects/experimental-JIT/webpack/cypress/support/component-index.html b/system-tests/projects/justInTimeCompile/webpack/cypress/support/component-index.html similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/cypress/support/component-index.html rename to system-tests/projects/justInTimeCompile/webpack/cypress/support/component-index.html diff --git a/system-tests/projects/experimental-JIT/webpack/cypress/support/component.js b/system-tests/projects/justInTimeCompile/webpack/cypress/support/component.js similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/cypress/support/component.js rename to system-tests/projects/justInTimeCompile/webpack/cypress/support/component.js diff --git a/system-tests/projects/experimental-JIT/webpack/package.json b/system-tests/projects/justInTimeCompile/webpack/package.json similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/package.json rename to system-tests/projects/justInTimeCompile/webpack/package.json diff --git a/system-tests/projects/experimental-JIT/webpack/src/Component-1.cy.jsx b/system-tests/projects/justInTimeCompile/webpack/src/Component-1.cy.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/src/Component-1.cy.jsx rename to system-tests/projects/justInTimeCompile/webpack/src/Component-1.cy.jsx diff --git a/system-tests/projects/experimental-JIT/webpack/src/Component-1.jsx b/system-tests/projects/justInTimeCompile/webpack/src/Component-1.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/src/Component-1.jsx rename to system-tests/projects/justInTimeCompile/webpack/src/Component-1.jsx diff --git a/system-tests/projects/experimental-JIT/webpack/src/Component-2.cy.jsx b/system-tests/projects/justInTimeCompile/webpack/src/Component-2.cy.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/src/Component-2.cy.jsx rename to system-tests/projects/justInTimeCompile/webpack/src/Component-2.cy.jsx diff --git a/system-tests/projects/experimental-JIT/webpack/src/Component-2.jsx b/system-tests/projects/justInTimeCompile/webpack/src/Component-2.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/src/Component-2.jsx rename to system-tests/projects/justInTimeCompile/webpack/src/Component-2.jsx diff --git a/system-tests/projects/experimental-JIT/webpack/src/Component-3.cy.jsx b/system-tests/projects/justInTimeCompile/webpack/src/Component-3.cy.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/src/Component-3.cy.jsx rename to system-tests/projects/justInTimeCompile/webpack/src/Component-3.cy.jsx diff --git a/system-tests/projects/experimental-JIT/webpack/src/Component-3.jsx b/system-tests/projects/justInTimeCompile/webpack/src/Component-3.jsx similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/src/Component-3.jsx rename to system-tests/projects/justInTimeCompile/webpack/src/Component-3.jsx diff --git a/system-tests/projects/experimental-JIT/webpack/webpack.config.js b/system-tests/projects/justInTimeCompile/webpack/webpack.config.js similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/webpack.config.js rename to system-tests/projects/justInTimeCompile/webpack/webpack.config.js diff --git a/system-tests/projects/experimental-JIT/webpack/yarn.lock b/system-tests/projects/justInTimeCompile/webpack/yarn.lock similarity index 100% rename from system-tests/projects/experimental-JIT/webpack/yarn.lock rename to system-tests/projects/justInTimeCompile/webpack/yarn.lock diff --git a/system-tests/test/experimental_jit.spec.ts b/system-tests/test/experimental_jit.spec.ts index ff625018e5e5..3afdcad64234 100644 --- a/system-tests/test/experimental_jit.spec.ts +++ b/system-tests/test/experimental_jit.spec.ts @@ -17,11 +17,11 @@ const getAllMatches = (source, regex) => { return matches } -describe('component testing: experimentalJustInTimeCompile', function () { +describe('component testing: justInTimeCompile', function () { systemTests.setup() systemTests.it('vite@5', { - project: 'experimental-JIT/vite', + project: 'justInTimeCompile/vite', testingType: 'component', browser: 'electron', expectedExitCode: 0, @@ -47,7 +47,7 @@ describe('component testing: experimentalJustInTimeCompile', function () { }) systemTests.it('webpack@5', { - project: 'experimental-JIT/webpack', + project: 'justInTimeCompile/webpack', testingType: 'component', browser: 'electron', expectedExitCode: 0, @@ -59,7 +59,7 @@ describe('component testing: experimentalJustInTimeCompile', function () { }, }) const serverPortRegex = /Component testing webpack server 5 started on port 8080/g - const componentsCompiledSeparatelyRegex = /experimental-JIT\/webpack\/src\/Component\-[1-3].cy.jsx/g + const componentsCompiledSeparatelyRegex = /justInTimeCompile\/webpack\/src\/Component\-[1-3].cy.jsx/g const totalServersSamePort = getAllMatches(stderr, serverPortRegex).length const totalComponentsCompiledSeparately = getAllMatches(stderr, componentsCompiledSeparatelyRegex).length