Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: Remove experimentalFetchPolyfill flag #30466

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ _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 `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).
- The `cypress open-ct` and `cypress run-ct` CLI commands were removed. Please use `cypress open --component` or `cypress run --component` respectively instead. Addressed in [#30456](/~https://github.com/cypress-io/cypress/pull/30456)
- The undocumented methods `Cypress.backend('firefox:force:gc')` and `Cypress.backend('log:memory:pressure')` were removed. Addresses [#30222](/~https://github.com/cypress-io/cypress/issues/30222).

Expand Down
4 changes: 0 additions & 4 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3181,10 +3181,6 @@ declare namespace Cypress {
* The user agent the browser sends in all request headers.
*/
userAgent: null | string
/**
* Polyfills `window.fetch` to enable Network spying and stubbing
*/
experimentalFetchPolyfill: boolean

/**
* Override default config options for Component Testing runner.
Expand Down
1 change: 0 additions & 1 deletion npm/react/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
'env': {
'reactDevtools': true,
},
'experimentalFetchPolyfill': true,
'component': {
experimentalSingleTabRunMode: true,
'excludeSpecPattern': [
Expand Down
1 change: 0 additions & 1 deletion npm/react/cypress/component/basic/network/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Mocking network

- [1-users-spec.js](1-users-spec.js) tests [1-users.jsx](1-users.jsx) that uses Axios to GET a list of users. Axios uses XMLHttpRequest to receive the data
- [2-users-fetch-spec.js](2-users-fetch-spec.js) tests [2-users-fetch.jsx](2-users-fetch.jsx) that uses `fetch` directly, assuming `"experimentalFetchPolyfill": true` in `cypress.json`, read [Experimental Fetch Polyfill](https://www.cypress.io/blog/2020/06/29/experimental-fetch-polyfill/)
1 change: 0 additions & 1 deletion npm/vue/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default defineConfig({
'viewportHeight': 500,
'responseTimeout': 2500,
'projectId': '134ej7',
'experimentalFetchPolyfill': true,
'e2e': {
'supportFile': false,
},
Expand Down
7 changes: 0 additions & 7 deletions packages/app/cypress/e2e/settings.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,6 @@ describe('App: Settings', () => {
href: 'https://on.cypress.io/experiments',
})

cy.get('[data-cy="experiment-experimentalFetchPolyfill"]').within(() => {
cy.validateExternalLink({
name: 'cy.intercept()',
href: 'https://on.cypress.io/intercept',
})
})

cy.get('[data-cy="experiment-experimentalInteractiveRunEvents"]').within(() => {
cy.validateExternalLink({
name: 'before:run',
Expand Down
3 changes: 0 additions & 3 deletions packages/config/__snapshots__/index.spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1
'env': {},
'execTimeout': 60000,
'experimentalCspAllowList': false,
'experimentalFetchPolyfill': false,
'experimentalInteractiveRunEvents': false,
'experimentalRunAllSpecs': false,
'experimentalMemoryManagement': false,
Expand Down Expand Up @@ -125,7 +124,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys f
'env': {},
'execTimeout': 60000,
'experimentalCspAllowList': false,
'experimentalFetchPolyfill': false,
'experimentalInteractiveRunEvents': false,
'experimentalRunAllSpecs': false,
'experimentalMemoryManagement': false,
Expand Down Expand Up @@ -212,7 +210,6 @@ exports['config/src/index .getPublicConfigKeys returns list of public config key
'env',
'execTimeout',
'experimentalCspAllowList',
'experimentalFetchPolyfill',
'experimentalInteractiveRunEvents',
'experimentalRunAllSpecs',
'experimentalMemoryManagement',
Expand Down
5 changes: 0 additions & 5 deletions packages/config/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,6 @@ const driverConfigOptions: Array<DriverConfigOption> = [
validation: validate.validateAny(validate.isBoolean, validate.isArrayIncludingAny('script-src-elem', 'script-src', 'default-src', 'form-action', 'child-src', 'frame-src')),
overrideLevel: 'never',
requireRestartOnChange: 'server',
}, {
name: 'experimentalFetchPolyfill',
defaultValue: false,
validation: validate.isBoolean,
isExperimental: true,
}, {
name: 'experimentalInteractiveRunEvents',
defaultValue: false,
Expand Down
2 changes: 0 additions & 2 deletions packages/config/test/project/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@ describe('config/src/project/utils', () => {
experimentalSkipDomainInjection: { value: null, from: 'default' },
experimentalJustInTimeCompile: { value: false, from: 'default' },
experimentalCspAllowList: { value: false, from: 'default' },
experimentalFetchPolyfill: { value: false, from: 'default' },
experimentalInteractiveRunEvents: { value: false, from: 'default' },
experimentalMemoryManagement: { value: false, from: 'default' },
experimentalOriginDependencies: { value: false, from: 'default' },
Expand Down Expand Up @@ -1159,7 +1158,6 @@ describe('config/src/project/utils', () => {
experimentalSkipDomainInjection: { value: null, from: 'default' },
experimentalJustInTimeCompile: { value: false, from: 'default' },
experimentalCspAllowList: { value: false, from: 'default' },
experimentalFetchPolyfill: { value: false, from: 'default' },
experimentalInteractiveRunEvents: { value: false, from: 'default' },
experimentalMemoryManagement: { value: false, from: 'default' },
experimentalOriginDependencies: { value: false, from: 'default' },
Expand Down
5 changes: 0 additions & 5 deletions packages/data-context/src/sources/migration/legacyOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ const resolvedOptions: Array<ResolvedConfigOption> = [
name: 'exit',
defaultValue: true,
canUpdateDuringTestTime: false,
}, {
name: 'experimentalFetchPolyfill',
defaultValue: false,
isExperimental: true,
canUpdateDuringTestTime: false,
}, {
name: 'experimentalInteractiveRunEvents',
defaultValue: false,
Expand Down
3 changes: 0 additions & 3 deletions packages/driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ Note: you may need to enable "Verbose" or "Debug" log levels inside the browser'

## Patches

- `sinon`
- `unfetch` to polyfill `fetch`. Added constructor function to point XMLHttpRequest to the application under test window.

Note: when creating a patch, make sure there is no `package-lock.json` file! Also rename the patch to have ".dev.patch" extension.

## Cross-origin Testing
Expand Down
1 change: 0 additions & 1 deletion packages/driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"source-map": "0.8.0-beta.0",
"text-mask-addons": "3.8.0",
"underscore.string": "3.3.6",
"unfetch": "4.1.0",
"url-parse": "1.5.10",
"vanilla-text-mask": "5.1.1",
"vite": "5.2.11",
Expand Down
Loading
Loading