From 7a38e36f45e988af336cde29fff6986404a73763 Mon Sep 17 00:00:00 2001 From: AtofStryker Date: Mon, 18 Nov 2024 15:47:46 -0500 Subject: [PATCH] remove the experimentalJIT flag and make it GA (default still false) [run ci] --- cli/types/cypress.d.ts | 16 +++---- .../src/makeDefaultWebpackConfig.ts | 6 +-- .../src/makeWebpackConfig.ts | 4 +- .../test/makeWebpackConfig.spec.ts | 4 +- ...y.ts => runner-ct.justInTimeCompile.cy.ts} | 8 ++-- packages/app/src/runner/index.ts | 4 +- .../config/__snapshots__/index.spec.ts.js | 6 +-- packages/config/src/options.ts | 16 ++++--- packages/config/test/project/utils.spec.ts | 42 ++++++++++++------- .../src/data/ProjectLifecycleManager.ts | 2 +- .../EXPERIMENTAL_JIT_COMPILE_REMOVED.html | 40 ++++++++++++++++++ ...ESTING.html => JIT_COMPONENT_TESTING.html} | 4 +- packages/errors/src/errors.ts | 12 ++++-- .../test/unit/visualSnapshotErrors_spec.ts | 7 +++- .../frontend-shared/src/locales/en-US.json | 4 -- packages/graphql/schemas/schema.graphql | 3 +- packages/server/lib/experiments.ts | 2 - packages/server/lib/modes/run.ts | 8 ++-- packages/types/src/config.ts | 2 +- system-tests/__snapshots__/results_spec.ts.js | 2 +- .../vite/cypress.config.js | 2 +- .../vite/cypress/support/component-index.html | 0 .../vite/cypress/support/component.js | 0 .../vite/package.json | 0 .../vite/src/Component-1.cy.jsx | 0 .../vite/src/Component-1.jsx | 0 .../vite/src/Component-2.cy.jsx | 0 .../vite/src/Component-2.jsx | 0 .../vite/src/Component-3.cy.jsx | 0 .../vite/src/Component-3.jsx | 0 .../vite/vite.config.js | 0 .../vite/yarn.lock | 0 .../webpack/README.md | 0 .../webpack/cypress.config.js | 2 +- .../cypress/support/component-index.html | 0 .../webpack/cypress/support/component.js | 0 .../webpack/package.json | 0 .../webpack/src/Component-1.cy.jsx | 0 .../webpack/src/Component-1.jsx | 0 .../webpack/src/Component-2.cy.jsx | 0 .../webpack/src/Component-2.jsx | 0 .../webpack/src/Component-3.cy.jsx | 0 .../webpack/src/Component-3.jsx | 0 .../webpack/webpack.config.js | 0 .../webpack/yarn.lock | 0 ..._jit.spec.ts => justInTimeCompile_spec.ts} | 10 ++--- 46 files changed, 131 insertions(+), 75 deletions(-) rename packages/app/cypress/e2e/runner/{runner-ct.experimentalJustInTimeCompile.cy.ts => runner-ct.justInTimeCompile.cy.ts} (75%) create mode 100644 packages/errors/__snapshot-html__/EXPERIMENTAL_JIT_COMPILE_REMOVED.html rename packages/errors/__snapshot-html__/{EXPERIMENTAL_JIT_COMPONENT_TESTING.html => JIT_COMPONENT_TESTING.html} (68%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/cypress.config.js (73%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/cypress/support/component-index.html (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/cypress/support/component.js (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/package.json (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/src/Component-1.cy.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/src/Component-1.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/src/Component-2.cy.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/src/Component-2.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/src/Component-3.cy.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/src/Component-3.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/vite.config.js (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/vite/yarn.lock (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/README.md (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/cypress.config.js (74%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/cypress/support/component-index.html (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/cypress/support/component.js (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/package.json (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/src/Component-1.cy.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/src/Component-1.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/src/Component-2.cy.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/src/Component-2.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/src/Component-3.cy.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/src/Component-3.jsx (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/webpack.config.js (100%) rename system-tests/projects/{experimental-JIT => justInTimeCompile}/webpack/yarn.lock (100%) rename system-tests/test/{experimental_jit.spec.ts => justInTimeCompile_spec.ts} (87%) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 5b92811c3531..aa20d620ad50 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 webpack-dev-server only. 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 @@ -3141,6 +3133,14 @@ declare namespace Cypress { * @default false */ experimentalMemoryManagement: boolean + /** + * 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 webpack-dev-server only. For component testing only. + * @see https://on.cypress.io/experiments#Configuration + */ + justInTimeCompile: boolean /** * Number of times to retry a failed test. * If a number is set, tests will retry in both runMode and openMode. 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/src/makeWebpackConfig.ts b/npm/webpack-dev-server/src/makeWebpackConfig.ts index 85e8df614568..c9adefcbfe09 100644 --- a/npm/webpack-dev-server/src/makeWebpackConfig.ts +++ b/npm/webpack-dev-server/src/makeWebpackConfig.ts @@ -80,12 +80,12 @@ export async function makeWebpackConfig ( cypressConfig: { projectRoot, supportFile, - experimentalJustInTimeCompile, + justInTimeCompile, }, framework, } = config.devServerConfig - const files = experimentalJustInTimeCompile ? [] : config.devServerConfig.specs + const files = justInTimeCompile ? [] : config.devServerConfig.specs if (!userWebpackConfig && !frameworkWebpackConfig) { debug('Not user or framework webpack config received. Trying to automatically source it') 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.justInTimeCompile.cy.ts similarity index 75% rename from packages/app/cypress/e2e/runner/runner-ct.experimentalJustInTimeCompile.cy.ts rename to packages/app/cypress/e2e/runner/runner-ct.justInTimeCompile.cy.ts index 2a5186642d53..1e003516c0e7 100644 --- a/packages/app/cypress/e2e/runner/runner-ct.experimentalJustInTimeCompile.cy.ts +++ b/packages/app/cypress/e2e/runner/runner-ct.justInTimeCompile.cy.ts @@ -2,18 +2,18 @@ import type { fixtureDirs } from '@tooling/system-tests' type ProjectDirs = typeof fixtureDirs -const EXPERIMENTAL_JIT_DIR: ProjectDirs[number] = 'experimental-JIT' +const JIT_DIR: ProjectDirs[number] = 'justInTimeCompile' const PROJECTS: {bundler: 'vite' | 'webpack'}[] = [ - // when running for vite, experimentalJustInTimeCompile=true is set but is a no-op for vite since JIT compiling is not supported in vite + // when running for vite, justInTimeCompile=true is set but is a no-op for vite since JIT compiling is not supported in vite { bundler: 'vite' }, { bundler: 'webpack' }, ] for (const { bundler } of PROJECTS) { - const PROJECT_NAME = `${EXPERIMENTAL_JIT_DIR}/${bundler}` + const PROJECT_NAME = `${JIT_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..1772bbc563d9 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': false, '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..09f514a01a8b 100644 --- a/packages/config/src/options.ts +++ b/packages/config/src/options.ts @@ -232,10 +232,9 @@ const driverConfigOptions: Array = [ isExperimental: true, requireRestartOnChange: 'server', }, { - name: 'experimentalJustInTimeCompile', + name: 'justInTimeCompile', defaultValue: false, validation: validate.isBoolean, - isExperimental: true, requireRestartOnChange: 'server', }, { name: 'experimentalOriginDependencies', @@ -632,6 +631,11 @@ export const breakingOptions: Readonly = [ errorKey: 'EXPERIMENTAL_SAMESITE_REMOVED', isWarning: true, }, { + name: 'experimentalJustInTimeCompile', + errorKey: 'EXPERIMENTAL_JIT_COMPILE_REMOVED', + isWarning: true, + }, + { name: 'experimentalNetworkStubbing', errorKey: 'EXPERIMENTAL_NETWORK_STUBBING_REMOVED', isWarning: true, @@ -736,8 +740,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 +760,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..ad5db967fe2a 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') @@ -1057,10 +1067,10 @@ describe('config/src/project/utils', () => { defaultCommandTimeout: { value: 4000, from: 'default' }, downloadsFolder: { value: 'cypress/downloads', from: 'default' }, env: {}, + 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' }, @@ -1073,8 +1083,8 @@ 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' }, includeShadowDom: { value: false, from: 'default' }, + justInTimeCompile: { value: false, from: 'default' }, isInteractive: { value: true, from: 'default' }, keystrokeDelay: { value: 0, from: 'default' }, modifyObstructiveCode: { value: true, from: 'default' }, @@ -1153,19 +1163,6 @@ describe('config/src/project/utils', () => { clientCertificates: { value: [], from: 'default' }, defaultCommandTimeout: { value: 4000, from: 'default' }, downloadsFolder: { value: 'cypress/downloads', 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' }, - experimentalOriginDependencies: { value: false, from: 'default' }, - experimentalRunAllSpecs: { value: false, from: 'default' }, - experimentalSingleTabRunMode: { value: false, from: 'default' }, - experimentalStudio: { value: false, from: 'default' }, - experimentalSourceRewriting: { value: false, from: 'default' }, - experimentalWebKitSupport: { value: false, from: 'default' }, env: { foo: { value: 'foo', @@ -1188,11 +1185,24 @@ describe('config/src/project/utils', () => { from: 'env', }, }, + excludeSpecPattern: { value: '*.hot-update.js', from: 'default' }, + execTimeout: { value: 60000, from: 'default' }, + experimentalModifyObstructiveThirdPartyCode: { value: false, from: 'default' }, + experimentalSkipDomainInjection: { value: null, from: 'default' }, + experimentalCspAllowList: { value: false, from: 'default' }, + experimentalInteractiveRunEvents: { value: false, from: 'default' }, + experimentalMemoryManagement: { value: false, from: 'default' }, + experimentalOriginDependencies: { value: false, from: 'default' }, + experimentalRunAllSpecs: { value: false, from: 'default' }, + experimentalSingleTabRunMode: { value: false, from: 'default' }, + experimentalStudio: { value: false, from: 'default' }, + experimentalSourceRewriting: { value: false, from: 'default' }, + experimentalWebKitSupport: { value: false, from: 'default' }, fileServerFolder: { value: '', from: 'default' }, fixturesFolder: { value: 'cypress/fixtures', from: 'default' }, hosts: { value: null, from: 'default' }, - excludeSpecPattern: { value: '*.hot-update.js', from: 'default' }, includeShadowDom: { value: false, from: 'default' }, + justInTimeCompile: { value: false, from: 'default' }, isInteractive: { value: true, from: 'default' }, keystrokeDelay: { value: 0, from: 'default' }, modifyObstructiveCode: { value: true, from: 'default' }, diff --git a/packages/data-context/src/data/ProjectLifecycleManager.ts b/packages/data-context/src/data/ProjectLifecycleManager.ts index 387032590921..547232fdfefc 100644 --- a/packages/data-context/src/data/ProjectLifecycleManager.ts +++ b/packages/data-context/src/data/ProjectLifecycleManager.ts @@ -241,7 +241,7 @@ 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 (for webpack-dev-server). In this case, we start a dev server + * 2. justInTimeCompile is enabled (for webpack-dev-server). 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. * The empty specs are handled within the @cypress/webpack-dev-server package as this has no impact on vite. 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..bf1e39768bf7 --- /dev/null +++ b/packages/errors/__snapshot-html__/EXPERIMENTAL_JIT_COMPILE_REMOVED.html @@ -0,0 +1,40 @@ + + + + + + + + + + + +
The experimentalJustInTimeCompile configuration option was removed in Cypress version 14.0.0.
+A new justInTimeCompile configuration option is available and is now false 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 ebe72e54a6c0..f7145d4e4832 100644 --- a/packages/errors/src/errors.ts +++ b/packages/errors/src/errors.ts @@ -1239,6 +1239,12 @@ 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(`false`)} 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 +1344,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 8427aee9f060..6687ecd1d337 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 8ed0f2c57d3a..c3b45421c4ed 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..86716f67edad 100644 --- a/system-tests/__snapshots__/results_spec.ts.js +++ b/system-tests/__snapshots__/results_spec.ts.js @@ -26,7 +26,7 @@ exports['module api and after:run results'] = ` "experimentalMemoryManagement": false, "experimentalModifyObstructiveThirdPartyCode": false, "experimentalSkipDomainInjection": null, - "experimentalJustInTimeCompile": false, + "justInTimeCompile": false, "experimentalOriginDependencies": false, "experimentalSourceRewriting": false, "experimentalSingleTabRunMode": false, 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..ea1d6007034a 100644 --- a/system-tests/projects/experimental-JIT/vite/cypress.config.js +++ b/system-tests/projects/justInTimeCompile/vite/cypress.config.js @@ -1,6 +1,6 @@ module.exports = { component: { - experimentalJustInTimeCompile: true, + justInTimeCompile: 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..89aeead60ac4 100644 --- a/system-tests/projects/experimental-JIT/webpack/cypress.config.js +++ b/system-tests/projects/justInTimeCompile/webpack/cypress.config.js @@ -1,6 +1,6 @@ module.exports = { component: { - experimentalJustInTimeCompile: true, + justInTimeCompile: 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/justInTimeCompile_spec.ts similarity index 87% rename from system-tests/test/experimental_jit.spec.ts rename to system-tests/test/justInTimeCompile_spec.ts index db7cdc33f844..f5035540f5e3 100644 --- a/system-tests/test/experimental_jit.spec.ts +++ b/system-tests/test/justInTimeCompile_spec.ts @@ -17,12 +17,12 @@ const getAllMatches = (source, regex) => { return matches } -describe('component testing: experimentalJustInTimeCompile', function () { +describe('component testing: justInTimeCompile', function () { systemTests.setup() - // makes sure experimentalJustInTimeCompile=true has no affect on how vite compiles files. + // makes sure justInTimeCompile=true has no affect on how vite compiles files. systemTests.it.only('vite@5', { - project: 'experimental-JIT/vite', + project: 'justInTimeCompile/vite', testingType: 'component', browser: 'electron', expectedExitCode: 0, @@ -48,7 +48,7 @@ describe('component testing: experimentalJustInTimeCompile', function () { }) systemTests.it('webpack@5', { - project: 'experimental-JIT/webpack', + project: 'justInTimeCompile/webpack', testingType: 'component', browser: 'electron', expectedExitCode: 0, @@ -60,7 +60,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