Skip to content

Commit

Permalink
Merge branch 'release/14.0.0' into chore/remove_support_react_19_rc_a…
Browse files Browse the repository at this point in the history
…nd_min_next_15_0_4
  • Loading branch information
jennifer-shehane authored Dec 10, 2024
2 parents c9d43a5 + 22776eb commit b1bab21
Show file tree
Hide file tree
Showing 97 changed files with 2,928 additions and 2,058 deletions.
2 changes: 1 addition & 1 deletion .circleci/cache-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Bump this version to force CI to re-create the cache from scratch.

11-26-24
12-04-24
44 changes: 38 additions & 6 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'build-binary-placeholder', << pipeline.git.branch >> ]
- equal: [ 'ryanm/chore/electron-33-upgrade', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -85,7 +85,7 @@ executors:
# the Docker image with Cypress dependencies and Chrome browser
cy-doc:
docker:
- image: cypress/browsers-internal:node20.18.0-bullseye-chrome129-ff131
- image: cypress/browsers-internal:node20.18.1-bullseye-chrome131-ff133
# by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed.
resource_class: medium
environment:
Expand All @@ -94,7 +94,7 @@ executors:

kitchensink-executor:
docker:
- image: cypress/browsers-internal:node20.18.0-bullseye-chrome129-ff131
- image: cypress/browsers-internal:node20.18.1-bullseye-chrome131-ff133
# by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed.
resource_class: medium
environment:
Expand All @@ -104,7 +104,7 @@ executors:
# Docker image with non-root "node" user
non-root-docker-user:
docker:
- image: cypress/browsers-internal:node20.18.0-bullseye-chrome129-ff131
- image: cypress/browsers-internal:node20.18.1-bullseye-chrome131-ff133
user: node
environment:
PLATFORM: linux
Expand Down Expand Up @@ -548,7 +548,7 @@ commands:
apt update && apt install -y docker.io
docker run -d --name better-sqlite3-builder cypress/base-internal:20.15.0-buster-python3.8-gcc-10.5 /bin/bash -c "sleep 1000000000"
docker cp ~/cypress/node_modules/better-sqlite3 better-sqlite3-builder:/better-sqlite3
docker exec -it better-sqlite3-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 32.2.0 --include-regex 'better_sqlite3.node$'"
docker exec -it better-sqlite3-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 33.2.1 --include-regex 'better_sqlite3.node$'"
docker cp better-sqlite3-builder:/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
docker rm -f better-sqlite3-builder
cp ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/better_sqlite3.node
Expand Down Expand Up @@ -1800,7 +1800,7 @@ jobs:
working_directory: ~/cypress
docker:
# we need an image with yarn 4 berry installed on it to run this test
- image: cypress/base-internal:20.18.0-yarn-berry
- image: cypress/base-internal:20.18.1-yarn-berry
environment:
# needed to inform the bootstrap-docker-container.sh script to link the binary in the system-test project directory
REPO_DIR: /root/cypress
Expand Down Expand Up @@ -1828,6 +1828,32 @@ jobs:
command: |
# we need to bootstrap the binary into our project directory and run the tests
source ./system-tests/scripts/bootstrap-docker-container.sh 'yarn cypress run'
# We can remove this job a once https://github.com/sveltejs/svelte-loader/issues/243 is resolved.
svelte-webpack-system-test:
parallelism: 1
working_directory: ~/cypress
docker:
- image: cypress/browsers-internal:node20.18.1-bullseye-chrome131-ff133
environment:
# needed to inform the bootstrap-docker-container.sh script to link the binary in the system-test project directory
REPO_DIR: /root/cypress
TEST_PROJECT_DIR: ./system-tests/projects/svelte-webpack-configured
USE_YARN_TO_INSTALL_CYPRESS_BINARY: true
steps:
- maybe_skip_binary_jobs
- attach_workspace:
at: ~/
- run:
name: Install monorepo dependencies
command: yarn install --ignore-scripts
- run:
name: install dependencies
command: cd ./system-tests/projects/svelte-webpack-configured && yarn
- run:
name: Bootstrap the Cypress binary and run binary system test
command: |
# we need to bootstrap the binary into our project directory and run the tests
source ./system-tests/scripts/bootstrap-docker-container.sh 'yarn cypress run --component --spec src/mount.cy.ts src/App.cy.ts'
system-tests-chrome:
<<: *defaults
Expand Down Expand Up @@ -2993,6 +3019,7 @@ linux-x64-workflow: &linux-x64-workflow
- test-npm-module-on-minimum-node-version
- binary-system-tests
- yarn-pnp-preprocessor-system-test
- svelte-webpack-system-test
- test-kitchensink
- unit-tests
- verify-release-readiness
Expand Down Expand Up @@ -3112,6 +3139,11 @@ linux-x64-workflow: &linux-x64-workflow
requires:
- get-published-artifacts
- system-tests-node-modules-install
- svelte-webpack-system-test:
context: publish-binary
requires:
- get-published-artifacts
- system-tests-node-modules-install

linux-x64-contributor-workflow: &linux-x64-contributor-workflow
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v20.18.0
placeholder: ex. v20.18.1
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2-memory-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v20.18.0
placeholder: ex. v20.18.1
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/3-install-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v20.18.0
placeholder: ex. v20.18.1
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18.0
20.18.1
9 changes: 5 additions & 4 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _Released 12/17/2024 (PENDING)_
- 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).
- 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).
- It is no longer possible to make a `fetch` or `XMLHttpRequest` request from the `about:blank` page in Electron (i.e. `cy.window().then((win) => win.fetch('<some-url>')`). You must use `cy.request` instead or perform some form of initial navigation via `cy.visit()`. Addressed in [#29547](https://github.com/cypress-io/cypress/pull/30394).
- Upgraded bundled Node.js version from `18.17.0` to `20.18.0`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547).
- Upgraded bundled Node.js version from `18.17.0` to `20.18.1`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547).
- `@cypress/webpack-dev-server` no longer supports `webpack-dev-server` version 3. Additionally, `@cypress/webpack-dev-server` now ships with `webpack-dev-server` version 5 by default. `webpack-dev-server` version 4 will need to be installed along side Cypress if you are still using `webpack` version 4. Addresses [#29308](https://github.com/cypress-io/cypress/issues/29308), [#30347](https://github.com/cypress-io/cypress/issues/30347), and [#30141](https://github.com/cypress-io/cypress/issues/30141).
- `@cypress/vite-dev-server` no longer supports `vite` versions 2 and 3. Addresses [#29377](https://github.com/cypress-io/cypress/issues/29377) and [#29378](https://github.com/cypress-io/cypress/issues/29378).
- 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).
Expand All @@ -20,7 +20,7 @@ _Released 12/17/2024 (PENDING)_
- `Next.js` versions 10, 11, 12, and 13. Addresses [#29583](https://github.com/cypress-io/cypress/issues/29583).
- `Nuxt.js` version 2. Addresses [#30468](https://github.com/cypress-io/cypress/issues/30468).
- `React` versions 16 and 17. Addresses [#29607](https://github.com/cypress-io/cypress/issues/29607).
- `Svelte` version 3. Addresses [#30492](https://github.com/cypress-io/cypress/issues/30492).
- `Svelte` versions 3 and 4. Addresses [#30492](https://github.com/cypress-io/cypress/issues/30492) and [#30692](https://github.com/cypress-io/cypress/issues/30692).
- `Vue` version 2. Addresses [#30295](https://github.com/cypress-io/cypress/issues/30295).
- The `cypress/react18` test harness is no longer included in the Cypress binary. Instead, React 18 support is now shipped with `cypress/react`! Addresses [#29607](https://github.com/cypress-io/cypress/issues/29607).
- The `cypress/angular-signals` test harness is no longer included in the Cypress binary. Instead, signals support is now shipped with `cypress/angular`! This requires `rxjs` to be installed as a `peerDependency`. Addresses [#29606](https://github.com/cypress-io/cypress/issues/29606).
Expand All @@ -43,6 +43,7 @@ in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addr
- `React` version 19. Addresses [#29470](https://github.com/cypress-io/cypress/issues/29470).
- `Angular` version 19. Addresses [#30175](https://github.com/cypress-io/cypress/issues/30175).
- `Vite` version 6. Addresses [#30591](https://github.com/cypress-io/cypress/issues/30591).
- `Svelte` version 5. Addresses [#29641](https://github.com/cypress-io/cypress/issues/29641).

**Bugfixes:**

Expand All @@ -58,9 +59,9 @@ in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addr

**Dependency Updates:**

- Upgraded `electron` from `27.3.10` to `32.2.0`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547).
- Upgraded `electron` from `27.3.10` to `33.2.1`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547) and [#30561](https://github.com/cypress-io/cypress/issues/30561).
- Upgraded `@electron/rebuild` from `3.2.10` to `3.7.1`. Addresses [#28766](https://github.com/cypress-io/cypress/issues/28766) and [#30632](https://github.com/cypress-io/cypress/issues/30632).
- Upgraded bundled Chromium version from `118.0.5993.159` to `128.0.6613.178`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547).
- Upgraded bundled Chromium version from `118.0.5993.159` to `130.0.6723.137`. Addresses [#29547](https://github.com/cypress-io/cypress/issues/29547) and [#30561](https://github.com/cypress-io/cypress/issues/30561).
- Updated `jQuery` from `3.4.1` to `3.7.1`. Addressed in [#30345](https://github.com/cypress-io/cypress/pull/30345).
- Updated `react` from `17.0.2` to `18.3.1` and `react-dom` from `17.0.2` to `18.3.1`. Addresses [#30511](https://github.com/cypress-io/cypress/issues/30511).

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
- .:/opt/cypress
ci:
# This should mirror the image used in workflows.yml
image: cypress/browsers-internal:node20.18.0-bullseye-chrome129-ff131
image: cypress/browsers-internal:node20.18.1-bullseye-chrome131-ff133
ports:
- 5566:5566
- 5567:5567
Expand Down
4 changes: 2 additions & 2 deletions npm/svelte/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# @cypress/svelte

Mount Svelte components in the open source [Cypress.io](https://www.cypress.io/) test runner **v10.7.0+**
Mount Svelte components in the open source [Cypress.io](https://www.cypress.io/) test runner

> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Svelte Component Testing Docs](https://docs.cypress.io/guides/component-testing/svelte/overview) for mounting Svelte components. Installing and importing `mount` from `@cypress/svelte` should only be done for advanced use-cases.
> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Svelte Component Testing Docs](https://docs.cypress.io/guides/component-testing/svelte/overview) for mounting Svelte components. Installing and importing `mount` from `@cypress/svelte` should only be done for advanced use-cases or in the case you may require an older or non supported version of svelte.
## Development

Expand Down
4 changes: 2 additions & 2 deletions npm/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
},
"devDependencies": {
"@cypress/mount-utils": "0.0.0-development",
"svelte": "^4.2.19",
"svelte": "^5.4.0",
"typescript": "~5.4.5"
},
"peerDependencies": {
"cypress": ">=10.6.0",
"svelte": ">=4.0.0"
"svelte": ">=5.0.0"
},
"files": [
"dist/**/*"
Expand Down
8 changes: 7 additions & 1 deletion npm/svelte/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { createEntries } from '@cypress/mount-utils/create-rollup-entry.mjs'

const config = {
external: [
'svelte',
],
}

// updated respectExternal to false due to this issue: https://github.com/Swatinem/rollup-plugin-dts/issues/162#issuecomment-1702374232
export default createEntries({ formats: ['es', 'cjs'], input: 'src/index.ts', dtsOptions: { respectExternal: false } })
export default createEntries({ formats: ['es', 'cjs'], input: 'src/index.ts', dtsOptions: { respectExternal: false }, config })
47 changes: 22 additions & 25 deletions npm/svelte/src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,25 @@ import {
getContainerEl,
setupHooks,
} from '@cypress/mount-utils'
import type { ComponentConstructorOptions, ComponentProps, SvelteComponent } from 'svelte'
import { mount as svelteMount, unmount as svelteUnmount } from 'svelte'
import type { MountOptions, Component } from 'svelte'

const DEFAULT_COMP_NAME = 'unknown'

type SvelteConstructor<T> = new (...args: any[]) => T;
type SvelteComponentOptions<T extends SvelteComponent> = Omit<
ComponentConstructorOptions<ComponentProps<T>>,
'hydrate' | 'target' | '$$inline'
>;

export interface MountOptions<T extends SvelteComponent>
extends SvelteComponentOptions<T> {
log?: boolean
}

export interface MountReturn<T extends SvelteComponent> {
component: T
export interface MountReturn{
component: Record<string, any>
}

let componentInstance: SvelteComponent | undefined
let componentInstance: Record<string, any> | undefined

const cleanup = () => {
componentInstance?.$destroy()
if (componentInstance) {
svelteUnmount(componentInstance)
}
}

// Extract the component name from the object passed to mount
const getComponentDisplayName = <T extends SvelteComponent>(Component: SvelteConstructor<T>): string => {
const getComponentDisplayName = (Component: Component<Record<string, any>, Record<string, any>, any>): string => {
if (Component.name) {
const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || []

Expand All @@ -41,7 +33,7 @@ const getComponentDisplayName = <T extends SvelteComponent>(Component: SvelteCon
/**
* Mounts a Svelte component inside the Cypress browser
*
* @param {SvelteConstructor<T>} Component Svelte component being mounted
* @param {Record<string, any>} Component Svelte component being mounted
* @param {MountReturn<T extends SvelteComponent>} options options to customize the component being mounted
* @returns Cypress.Chainable<MountReturn>
*
Expand All @@ -56,19 +48,24 @@ const getComponentDisplayName = <T extends SvelteComponent>(Component: SvelteCon
*
* @see {@link https://on.cypress.io/mounting-svelte} for more details.
*/
export function mount<T extends SvelteComponent> (
Component: SvelteConstructor<T>,
options: MountOptions<T> = {},
): Cypress.Chainable<MountReturn<T>> {
export function mount (
Component: Component<Record<string, any>, Record<string, any>, any>,
options: Omit<MountOptions, 'target'> & {log?: boolean} = {},
): Cypress.Chainable<MountReturn> {
// In Svelte 5, the component name is no longer easily discoverable and logs as "wrapper"
// so we default the logging of it to false as it doesn't provide a lot of value
options.log = options.log || false

return cy.then(() => {
// Remove last mounted component if cy.mount is called more than once in a test
cleanup()

const target = getContainerEl()

const ComponentConstructor = ((Component as any).default || Component) as SvelteConstructor<T>
const ComponentConstructor = ((Component as any).default || Component) as Component<Record<string, any>, Record<string, any>, any>

componentInstance = new ComponentConstructor({
// @see https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes
componentInstance = svelteMount(ComponentConstructor, {
target,
...options,
})
Expand All @@ -85,7 +82,7 @@ export function mount<T extends SvelteComponent> (
})
}
})
.wrap({ component: componentInstance as T }, { log: false })
.wrap({ component: componentInstance as Record<string, any> }, { log: false })
})
}

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
"dedent": "^0.7.0",
"del": "3.0.0",
"detect-port": "^1.6.1",
"electron": "32.2.0",
"electron-builder": "^23.6.0",
"electron": "33.2.1",
"electron-builder": "^25.1.8",
"enzyme-adapter-react-16": "1.12.1",
"eslint": "^8.56.0",
"eslint-plugin-cypress": "3.5.0",
Expand Down Expand Up @@ -212,7 +212,7 @@
"yarn-deduplicate": "3.1.0"
},
"engines": {
"node": ">=20.18.0",
"node": ">=20.18.1",
"yarn": ">=1.22.17"
},
"productName": "Cypress",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"node-machine-id": "1.1.12",
"p-defer": "^3.0.0",
"parse-glob": "3.0.4",
"prettier": "2.5.1",
"prettier": "2.8.8",
"randexp": "0.5.3",
"randomstring": "1.3.0",
"react-docgen": "6.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('scaffolding component testing', {
cy.contains('button', 'Next step').click()
cy.findByRole('button', { name: 'Continue' }).click()
cy.get('[data-cy="launchpad-Configuration files"]').should('be.visible')
verifyConfigFile(`cypress.config.js`)
verifyConfigFile(`cypress.config.ts`)
})
})

Expand All @@ -160,7 +160,7 @@ describe('scaffolding component testing', {
cy.contains('button', 'Next step').click()
cy.findByRole('button', { name: 'Continue' }).click()
cy.get('[data-cy="launchpad-Configuration files"]').should('be.visible')
verifyConfigFile(`cypress.config.js`)
verifyConfigFile(`cypress.config.ts`)
})
})

Expand Down
Loading

2 comments on commit b1bab21

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b1bab21 Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.0/linux-x64/chore/remove_support_react_19_rc_and_min_next_15_0_4-b1bab21e993795e4d581c098e5214ea4a800975c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b1bab21 Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.0/linux-arm64/chore/remove_support_react_19_rc_and_min_next_15_0_4-b1bab21e993795e4d581c098e5214ea4a800975c/cypress.tgz

Please sign in to comment.