From 459f68ed127fa1e23598c1e0c8c1a3e10da0d902 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Thu, 4 Nov 2021 20:51:34 -0500 Subject: [PATCH 1/7] Remove IE11 asset size checks (#7737) --- .github/workflows/asset-size-check.yml | 21 +------------------ .../src/create-comment-text.js | 7 +------ 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/.github/workflows/asset-size-check.yml b/.github/workflows/asset-size-check.yml index 2313e152748..988f1f0d6a0 100644 --- a/.github/workflows/asset-size-check.yml +++ b/.github/workflows/asset-size-check.yml @@ -29,10 +29,6 @@ jobs: run: git checkout master - name: Install dependencies for master run: yarn install - - name: Build Production master (IE11) - run: | - mkdir -p packages/-ember-data/dists - EMBER_DATA_FULL_COMPAT=true TARGET_IE11=true yarn workspace ember-data ember build -e production --output-path dists/control-ie11 - name: Build Production master run: EMBER_DATA_FULL_COMPAT=true yarn workspace ember-data ember build -e production --output-path dists/control - name: Build Production master (no rollup) @@ -43,31 +39,20 @@ jobs: git checkout --progress --force $sha - name: Install dependencies for ${{github.ref}} run: yarn install - - name: Build Production ${{github.ref}} (IE11) - run: EMBER_DATA_FULL_COMPAT=true TARGET_IE11=true yarn workspace ember-data ember build -e production --output-path dists/experiment-ie11 - name: Build Production ${{github.ref}} run: EMBER_DATA_FULL_COMPAT=true yarn workspace ember-data ember build -e production --output-path dists/experiment - name: Build Production ${{github.ref}} (no rollup) run: EMBER_DATA_FULL_COMPAT=true EMBER_DATA_ROLLUP_PRIVATE=false yarn workspace ember-data ember build -e production --output-path dists/experiment-no-rollup - - name: Analyze Master Assets (IE11) + - name: Analyze Master Assets run: | - node ./scripts/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/control-ie11 ./control-ie11-data.json mkdir -p tmp mkdir -p tmp/asset-sizes - node ./scripts/asset-size-tracking/print-analysis.js ./control-ie11-data.json -show > tmp/asset-sizes/master-analysis-ie11.txt - - name: Analyze Master Assets - run: | node ./scripts/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/control ./control-data.json node ./scripts/asset-size-tracking/print-analysis.js ./control-data.json -show > tmp/asset-sizes/master-analysis.txt - name: Analyze Master Assets (no rollup) run: | node ./scripts/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/control-no-rollup ./control-data-no-rollup.json node ./scripts/asset-size-tracking/print-analysis.js ./control-data-no-rollup.json -show > tmp/asset-sizes/master-analysis-no-rollup.txt - - name: Analyze ${{github.ref}} Assets (IE11) - run: | - node ./scripts/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/experiment-ie11 ./experiment-ie11-data.json - node ./scripts/asset-size-tracking/print-analysis.js ./experiment-ie11-data.json -show > tmp/asset-sizes/experiment-analysis-ie11-full.txt - node ./scripts/asset-size-tracking/print-analysis.js ./experiment-ie11-data.json > tmp/asset-sizes/experiment-analysis-ie11.txt - name: Analyze ${{github.ref}} Assets run: | node ./scripts/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/experiment ./experiment-data.json @@ -78,10 +63,6 @@ jobs: node ./scripts/asset-size-tracking/generate-analysis.js packages/-ember-data/dists/experiment-no-rollup ./experiment-data-no-rollup.json node ./scripts/asset-size-tracking/print-analysis.js ./experiment-data-no-rollup.json -show > tmp/asset-sizes/experiment-analysis-no-rollup-full.txt node ./scripts/asset-size-tracking/print-analysis.js ./experiment-data-no-rollup.json > tmp/asset-sizes/experiment-analysis-no-rollup.txt - - name: Test Asset Sizes (IE11) - run: | - set -o pipefail - node ./scripts/asset-size-tracking/generate-diff.js ./control-ie11-data.json ./experiment-ie11-data.json | tee tmp/asset-sizes/diff-ie11.txt - name: Test Asset Sizes if: failure() || success() run: | diff --git a/scripts/asset-size-tracking/src/create-comment-text.js b/scripts/asset-size-tracking/src/create-comment-text.js index db9de53158b..e30c2c0bf13 100644 --- a/scripts/asset-size-tracking/src/create-comment-text.js +++ b/scripts/asset-size-tracking/src/create-comment-text.js @@ -3,8 +3,6 @@ const path = require('path'); const GITHUB_SHA = process.argv[2]; -const IE11DiffPath = path.resolve(__dirname, '../../../tmp/asset-sizes/diff-ie11.txt'); -const IE11AnalysisPath = path.resolve(__dirname, '../../../tmp/asset-sizes/experiment-analysis-ie11.txt'); const ModernDiffPath = path.resolve(__dirname, '../../../tmp/asset-sizes/diff.txt'); const ModernAnalysisPath = path.resolve(__dirname, '../../../tmp/asset-sizes/experiment-analysis.txt'); const ModernDiffPathNoRollup = path.resolve(__dirname, '../../../tmp/asset-sizes/diff-no-rollup.txt'); @@ -13,15 +11,12 @@ const ModernAnalysisPathNoRollup = path.resolve( '../../../tmp/asset-sizes/experiment-analysis-no-rollup.txt' ); -const IE11DiffText = fs.readFileSync(IE11DiffPath); -const IE11AnalysisText = fs.readFileSync(IE11AnalysisPath); const ModernDiffText = fs.readFileSync(ModernDiffPath); const ModernAnalysisText = fs.readFileSync(ModernAnalysisPath); const ModernDiffTextNoRollup = fs.readFileSync(ModernDiffPathNoRollup); const ModernAnalysisTextNoRollup = fs.readFileSync(ModernAnalysisPathNoRollup); -const commentText = `Asset Size Report for ${GITHUB_SHA}\n\n**IE11 Builds**\n${IE11DiffText}\n
\n Full Asset Analysis (IE11)\n\n\`\`\`${IE11AnalysisText}\n\`\`\`\n
-\n**Modern Builds**\n${ModernDiffText}\n
\n Full Asset Analysis (Modern)\n\n\`\`\`${ModernAnalysisText}\n\`\`\`\n
+const commentText = `Asset Size Report for ${GITHUB_SHA}\n\n**Modern Builds**\n${ModernDiffText}\n
\n Full Asset Analysis (Modern)\n\n\`\`\`${ModernAnalysisText}\n\`\`\`\n
\n**Modern Builds (No Rollup)**\n${ModernDiffTextNoRollup}\n
\n Full Asset Analysis (Modern)\n\n\`\`\`${ModernAnalysisTextNoRollup}\n\`\`\`\n
`; const commentJSON = { body: commentText, From 85269c94beee0616fd0d5bf22a01f63c1affc843 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Thu, 4 Nov 2021 22:28:26 -0500 Subject: [PATCH 2/7] Remove TARGET_IE11 flag (#7739) * Remove TARGET_IE11 flag * SHOULD_TRANSPILE just like emberjs * just do all browsers in prod env * update moar targets --- .github/workflows/main.yml | 7 +------ packages/-ember-data/config/ember-try.js | 7 ------- packages/-ember-data/ember-cli-build.js | 3 +-- packages/-ember-data/tests/dummy/config/targets.js | 8 ++++---- packages/adapter/tests/dummy/config/targets.js | 9 ++++----- packages/debug/tests/dummy/config/targets.js | 9 ++++----- packages/model/tests/dummy/config/targets.js | 9 ++++----- packages/record-data/tests/dummy/config/targets.js | 8 ++++---- packages/serializer/tests/dummy/config/targets.js | 9 ++++----- packages/store/tests/dummy/config/targets.js | 9 ++++----- .../config/targets.js | 10 ++++------ .../config/targets.js | 10 ++++------ .../unpublished-fastboot-test-app/config/targets.js | 10 ++++------ .../config/targets.js | 10 ++++------ .../unpublished-model-encapsulation-test-app/testem.js | 9 +-------- .../config/targets.js | 10 ++++------ .../config/targets.js | 10 ++++------ .../tests/dummy/config/targets.js | 10 ++++------ 18 files changed, 59 insertions(+), 98 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2db912bf62..ad07976aa69 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -147,13 +147,9 @@ jobs: strategy: fail-fast: false matrix: - launcher: [Chrome, Firefox, IE] + launcher: [Chrome, Firefox] os: [macos-latest, windows-latest, ubuntu-latest] exclude: - - os: macos-latest - launcher: IE - - os: ubuntu-latest - launcher: IE - os: ubuntu-latest launcher: Firefox - os: windows-latest @@ -253,7 +249,6 @@ jobs: matrix: scenario: [ - with-max-transpilation, with-native-fetch, with-ember-fetch-no-jquery, with-ember-fetch-and-jquery, diff --git a/packages/-ember-data/config/ember-try.js b/packages/-ember-data/config/ember-try.js index 2e6f57560f7..64bcc741163 100644 --- a/packages/-ember-data/config/ember-try.js +++ b/packages/-ember-data/config/ember-try.js @@ -7,13 +7,6 @@ module.exports = function () { return { useYarn: true, scenarios: [ - { - name: 'with-max-transpilation', - env: { - TARGET_IE11: true, - }, - npm: {}, - }, { name: 'with-ember-fetch-no-jquery', env: { diff --git a/packages/-ember-data/ember-cli-build.js b/packages/-ember-data/ember-cli-build.js index 709aa618f50..1c29f48d99c 100644 --- a/packages/-ember-data/ember-cli-build.js +++ b/packages/-ember-data/ember-cli-build.js @@ -5,14 +5,13 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function (defaults) { const isTest = process.env.EMBER_CLI_TEST_COMMAND; const isProd = process.env.EMBER_ENV === 'production'; - const needsIE11 = !!process.env.TARGET_IE11; const compatWith = process.env.EMBER_DATA_FULL_COMPAT ? '99.0' : null; const terserSettings = { exclude: ['assets/dummy.js', 'assets/tests.js', 'assets/test-support.js', 'dist/docs/*', 'docs/*'], }; - if (isTest && isProd && needsIE11) { + if (isTest && isProd) { terserSettings.enabled = false; } diff --git a/packages/-ember-data/tests/dummy/config/targets.js b/packages/-ember-data/tests/dummy/config/targets.js index 4fd3ea66e38..b6756da2517 100644 --- a/packages/-ember-data/tests/dummy/config/targets.js +++ b/packages/-ember-data/tests/dummy/config/targets.js @@ -1,10 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; -const targetIsIE11 = process.env.TESTEM_CI_LAUNCHER === 'IE' || !!process.env.TARGET_IE11; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -if (targetIsIE11) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/adapter/tests/dummy/config/targets.js b/packages/adapter/tests/dummy/config/targets.js index 23eb67a388d..b6756da2517 100644 --- a/packages/adapter/tests/dummy/config/targets.js +++ b/packages/adapter/tests/dummy/config/targets.js @@ -1,11 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const needsIE11 = !!process.env.TARGET_IE11; - -if (needsIE11) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/debug/tests/dummy/config/targets.js b/packages/debug/tests/dummy/config/targets.js index 23eb67a388d..b6756da2517 100644 --- a/packages/debug/tests/dummy/config/targets.js +++ b/packages/debug/tests/dummy/config/targets.js @@ -1,11 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const needsIE11 = !!process.env.TARGET_IE11; - -if (needsIE11) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/model/tests/dummy/config/targets.js b/packages/model/tests/dummy/config/targets.js index 23eb67a388d..b6756da2517 100644 --- a/packages/model/tests/dummy/config/targets.js +++ b/packages/model/tests/dummy/config/targets.js @@ -1,11 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const needsIE11 = !!process.env.TARGET_IE11; - -if (needsIE11) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/record-data/tests/dummy/config/targets.js b/packages/record-data/tests/dummy/config/targets.js index 4fd3ea66e38..b6756da2517 100644 --- a/packages/record-data/tests/dummy/config/targets.js +++ b/packages/record-data/tests/dummy/config/targets.js @@ -1,10 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; -const targetIsIE11 = process.env.TESTEM_CI_LAUNCHER === 'IE' || !!process.env.TARGET_IE11; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -if (targetIsIE11) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/serializer/tests/dummy/config/targets.js b/packages/serializer/tests/dummy/config/targets.js index 23eb67a388d..b6756da2517 100644 --- a/packages/serializer/tests/dummy/config/targets.js +++ b/packages/serializer/tests/dummy/config/targets.js @@ -1,11 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const needsIE11 = !!process.env.TARGET_IE11; - -if (needsIE11) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/store/tests/dummy/config/targets.js b/packages/store/tests/dummy/config/targets.js index 23eb67a388d..b6756da2517 100644 --- a/packages/store/tests/dummy/config/targets.js +++ b/packages/store/tests/dummy/config/targets.js @@ -1,11 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const needsIE11 = !!process.env.TARGET_IE11; - -if (needsIE11) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/unpublished-adapter-encapsulation-test-app/config/targets.js b/packages/unpublished-adapter-encapsulation-test-app/config/targets.js index 7c76181f14f..b6756da2517 100644 --- a/packages/unpublished-adapter-encapsulation-test-app/config/targets.js +++ b/packages/unpublished-adapter-encapsulation-test-app/config/targets.js @@ -1,12 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const isCI = !!process.env.CI; -const isProduction = process.env.EMBER_ENV === 'production'; - -if (isCI || isProduction) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/unpublished-debug-encapsulation-test-app/config/targets.js b/packages/unpublished-debug-encapsulation-test-app/config/targets.js index 7c76181f14f..b6756da2517 100644 --- a/packages/unpublished-debug-encapsulation-test-app/config/targets.js +++ b/packages/unpublished-debug-encapsulation-test-app/config/targets.js @@ -1,12 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const isCI = !!process.env.CI; -const isProduction = process.env.EMBER_ENV === 'production'; - -if (isCI || isProduction) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/unpublished-fastboot-test-app/config/targets.js b/packages/unpublished-fastboot-test-app/config/targets.js index 7c76181f14f..b6756da2517 100644 --- a/packages/unpublished-fastboot-test-app/config/targets.js +++ b/packages/unpublished-fastboot-test-app/config/targets.js @@ -1,12 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const isCI = !!process.env.CI; -const isProduction = process.env.EMBER_ENV === 'production'; - -if (isCI || isProduction) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/unpublished-model-encapsulation-test-app/config/targets.js b/packages/unpublished-model-encapsulation-test-app/config/targets.js index 7c76181f14f..b6756da2517 100644 --- a/packages/unpublished-model-encapsulation-test-app/config/targets.js +++ b/packages/unpublished-model-encapsulation-test-app/config/targets.js @@ -1,12 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const isCI = !!process.env.CI; -const isProduction = process.env.EMBER_ENV === 'production'; - -if (isCI || isProduction) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/unpublished-model-encapsulation-test-app/testem.js b/packages/unpublished-model-encapsulation-test-app/testem.js index e11b225fce9..6284ee221b7 100644 --- a/packages/unpublished-model-encapsulation-test-app/testem.js +++ b/packages/unpublished-model-encapsulation-test-app/testem.js @@ -1,18 +1,11 @@ // eslint-disable-next-line node/no-unpublished-require const customDotReporter = require('@ember-data/unpublished-test-infra/src/testem/custom-dot-reporter'); -const TestIE = process.env.TEST_IE11; - -if (TestIE) { - // eslint-disable-next-line no-console - console.log('\n\nLaunching with IE\n\n'); -} - module.exports = { test_page: 'tests/index.html?hidepassed&nocontainer', disable_watching: true, reporter: customDotReporter, - launch_in_ci: TestIE ? ['IE'] : ['Chrome'], + launch_in_ci: ['Chrome'], launch_in_dev: ['Chrome'], browser_start_timeout: 120, browser_args: { diff --git a/packages/unpublished-record-data-encapsulation-test-app/config/targets.js b/packages/unpublished-record-data-encapsulation-test-app/config/targets.js index 7c76181f14f..b6756da2517 100644 --- a/packages/unpublished-record-data-encapsulation-test-app/config/targets.js +++ b/packages/unpublished-record-data-encapsulation-test-app/config/targets.js @@ -1,12 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const isCI = !!process.env.CI; -const isProduction = process.env.EMBER_ENV === 'production'; - -if (isCI || isProduction) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/unpublished-serializer-encapsulation-test-app/config/targets.js b/packages/unpublished-serializer-encapsulation-test-app/config/targets.js index 7c76181f14f..b6756da2517 100644 --- a/packages/unpublished-serializer-encapsulation-test-app/config/targets.js +++ b/packages/unpublished-serializer-encapsulation-test-app/config/targets.js @@ -1,12 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const isCI = !!process.env.CI; -const isProduction = process.env.EMBER_ENV === 'production'; - -if (isCI || isProduction) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { diff --git a/packages/unpublished-test-infra/tests/dummy/config/targets.js b/packages/unpublished-test-infra/tests/dummy/config/targets.js index 7c76181f14f..b6756da2517 100644 --- a/packages/unpublished-test-infra/tests/dummy/config/targets.js +++ b/packages/unpublished-test-infra/tests/dummy/config/targets.js @@ -1,12 +1,10 @@ 'use strict'; -const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +let browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; +const isProd = process.env.EMBER_ENV === 'production'; -const isCI = !!process.env.CI; -const isProduction = process.env.EMBER_ENV === 'production'; - -if (isCI || isProduction) { - browsers.push('ie 11'); +if (isProd) { + browsers = ['last 2 Chrome versions', 'last 2 Firefox versions', 'Safari 12', 'last 2 Edge versions']; } module.exports = { From 0ac7b65b0a04069cbc56977be1d6bd0e7fc87d91 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Fri, 5 Nov 2021 01:58:17 -0500 Subject: [PATCH 3/7] Remove symbol util in place of built in Symbol (#7740) --- .eslintrc.js | 1 - packages/adapter/addon/rest.ts | 7 ++-- .../store/addon/-private/identifiers/cache.ts | 5 ++- packages/store/addon/-private/index.ts | 1 - .../store/addon/-private/system/core-store.ts | 3 +- .../addon/-private/system/fetch-manager.ts | 3 +- .../addon/-private/system/request-cache.ts | 13 ++++---- .../-private/ts-interfaces/identifier.ts | 5 ++- packages/store/addon/-private/utils/symbol.ts | 33 ------------------- .../qunit-asserts/assert-deprecation.ts | 2 -- .../qunit-asserts/utils/symbol-ponyfill.ts | 6 ---- tsconfig.json | 1 - 12 files changed, 15 insertions(+), 65 deletions(-) delete mode 100644 packages/store/addon/-private/utils/symbol.ts delete mode 100644 packages/unpublished-test-infra/addon-test-support/qunit-asserts/utils/symbol-ponyfill.ts diff --git a/.eslintrc.js b/.eslintrc.js index b7cf59afab4..97b43305a6f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -180,7 +180,6 @@ module.exports = { 'packages/store/tests/dummy/app/config/environment.d.ts', 'packages/store/tests/dummy/app/app.ts', 'packages/store/addon/index.ts', - 'packages/store/addon/-private/utils/symbol.ts', 'packages/store/addon/-private/utils/promise-record.ts', 'packages/store/addon/-private/utils/is-non-empty-string.ts', 'packages/store/addon/-private/utils/construct-resource.ts', diff --git a/packages/adapter/addon/rest.ts b/packages/adapter/addon/rest.ts index f8081da647b..53a90191e2a 100644 --- a/packages/adapter/addon/rest.ts +++ b/packages/adapter/addon/rest.ts @@ -11,7 +11,6 @@ import { has } from 'require'; import { Promise as RSVPPromise } from 'rsvp'; import { DEPRECATE_NAJAX } from '@ember-data/private-build-infra/deprecations'; -import { addSymbol, symbol } from '@ember-data/store/-private'; import type Store from '@ember-data/store/-private/system/core-store'; import type ShimModelClass from '@ember-data/store/-private/system/model/shim-model-class'; import type Snapshot from '@ember-data/store/-private/system/snapshot'; @@ -72,7 +71,7 @@ type ResponseData = { declare const najax: Function | undefined; declare const jQuery: JQueryStatic | undefined; -const UseFetch = symbol('useFetch'); +const UseFetch = Symbol('useFetch'); const hasJQuery = typeof jQuery !== 'undefined'; /** @@ -1628,13 +1627,13 @@ if (DEPRECATE_NAJAX) { shouldUseFetch = true; } - addSymbol(this, UseFetch, shouldUseFetch); + this[UseFetch] = shouldUseFetch; return shouldUseFetch; }, set(value) { - addSymbol(this, UseFetch, value); + this[UseFetch] = value; return value; }, }); diff --git a/packages/store/addon/-private/identifiers/cache.ts b/packages/store/addon/-private/identifiers/cache.ts index b596edf30ad..1d1f38021cd 100644 --- a/packages/store/addon/-private/identifiers/cache.ts +++ b/packages/store/addon/-private/identifiers/cache.ts @@ -22,7 +22,6 @@ import type { import { DEBUG_CLIENT_ORIGINATED, DEBUG_IDENTIFIER_BUCKET } from '../ts-interfaces/identifier'; import type { ConfidentDict } from '../ts-interfaces/utils'; import isNonEmptyString from '../utils/is-non-empty-string'; -import { addSymbol } from '../utils/symbol'; import isStableIdentifier, { markStableIdentifier, unmarkStableIdentifier } from './is-stable-identifier'; import uuidv4 from './utils/uuid-v4'; @@ -510,8 +509,8 @@ function makeStableRecordIdentifier( return `${clientOriginated ? '[CLIENT_ORIGINATED] ' : ''}${type}:${id} (${lid})`; }, }; - addSymbol(wrapper, DEBUG_CLIENT_ORIGINATED, clientOriginated); - addSymbol(wrapper, DEBUG_IDENTIFIER_BUCKET, bucket); + wrapper[DEBUG_CLIENT_ORIGINATED] = clientOriginated; + wrapper[DEBUG_IDENTIFIER_BUCKET] = bucket; wrapper = freeze(wrapper); markStableIdentifier(wrapper); DEBUG_MAP.set(wrapper, recordIdentifier); diff --git a/packages/store/addon/-private/index.ts b/packages/store/addon/-private/index.ts index 16fb90d09c3..a524888b5f9 100644 --- a/packages/store/addon/-private/index.ts +++ b/packages/store/addon/-private/index.ts @@ -25,7 +25,6 @@ export { default as RootState } from './system/model/states'; export { default as InternalModel } from './system/model/internal-model'; export { PromiseArray, PromiseObject } from './system/promise-proxies'; -export { addSymbol, symbol } from './utils/symbol'; export { RecordArray, AdapterPopulatedRecordArray } from './system/record-arrays'; diff --git a/packages/store/addon/-private/system/core-store.ts b/packages/store/addon/-private/system/core-store.ts index 31058f81d60..a8f74c4dd0c 100644 --- a/packages/store/addon/-private/system/core-store.ts +++ b/packages/store/addon/-private/system/core-store.ts @@ -67,7 +67,6 @@ import type { FindOptions } from '../ts-interfaces/store'; import type { Dict } from '../ts-interfaces/utils'; import constructResource from '../utils/construct-resource'; import promiseRecord from '../utils/promise-record'; -import { addSymbol } from '../utils/symbol'; import edBackburner from './backburner'; import coerceId, { ensureStringId } from './coerce-id'; import { errorsArrayToHash } from './errors-utils'; @@ -2713,7 +2712,7 @@ abstract class CoreStore extends Service { operation = 'deleteRecord'; } - addSymbol(options, SaveOp, operation); + options[SaveOp] = operation; let fetchManagerPromise = this._fetchManager.scheduleSave(internalModel.identifier, options); let promise = fetchManagerPromise.then( diff --git a/packages/store/addon/-private/system/fetch-manager.ts b/packages/store/addon/-private/system/fetch-manager.ts index b6a7aa5b974..bebe5840b3d 100644 --- a/packages/store/addon/-private/system/fetch-manager.ts +++ b/packages/store/addon/-private/system/fetch-manager.ts @@ -12,7 +12,6 @@ import type { CollectionResourceDocument, SingleResourceDocument } from '../ts-i import type { FindRecordQuery, Request, SaveRecordMutation } from '../ts-interfaces/fetch-manager'; import type { ExistingRecordIdentifier, RecordIdentifier, StableRecordIdentifier } from '../ts-interfaces/identifier'; import type { Dict } from '../ts-interfaces/utils'; -import { symbol } from '../utils/symbol'; import coerceId from './coerce-id'; import type CoreStore from './core-store'; import { errorsArrayToHash } from './errors-utils'; @@ -30,7 +29,7 @@ function payloadIsNotBlank(adapterPayload): boolean { } } -export const SaveOp: unique symbol = symbol('SaveOp'); +export const SaveOp: unique symbol = Symbol('SaveOp'); interface PendingFetchItem { identifier: ExistingRecordIdentifier; diff --git a/packages/store/addon/-private/system/request-cache.ts b/packages/store/addon/-private/system/request-cache.ts index c0cd5921f8b..d2f78be6f6d 100644 --- a/packages/store/addon/-private/system/request-cache.ts +++ b/packages/store/addon/-private/system/request-cache.ts @@ -7,10 +7,9 @@ import type { } from '../ts-interfaces/fetch-manager'; import { RequestStateEnum } from '../ts-interfaces/fetch-manager'; import type { RecordIdentifier } from '../ts-interfaces/identifier'; -import { addSymbol, symbol } from '../utils/symbol'; -const Touching: unique symbol = symbol('touching'); -export const RequestPromise: unique symbol = symbol('promise'); +const Touching: unique symbol = Symbol('touching'); +export const RequestPromise: unique symbol = Symbol('promise'); interface InternalRequest extends RequestState { [Touching]: RecordIdentifier[]; @@ -41,8 +40,8 @@ export default class RequestCache { request: queryRequest, type, } as InternalRequest; - addSymbol(request, Touching, [query.recordIdentifier]); - addSymbol(request, RequestPromise, promise); + request[Touching] = [query.recordIdentifier]; + request[RequestPromise] = promise; this._pending[lid].push(request); this._triggerSubscriptions(request); promise.then( @@ -54,7 +53,7 @@ export default class RequestCache { type, response: { data: result }, } as InternalRequest; - addSymbol(finalizedRequest, Touching, request[Touching]); + finalizedRequest[Touching] = request[Touching]; this._addDone(finalizedRequest); this._triggerSubscriptions(finalizedRequest); }, @@ -66,7 +65,7 @@ export default class RequestCache { type, response: { data: error && error.error }, } as InternalRequest; - addSymbol(finalizedRequest, Touching, request[Touching]); + finalizedRequest[Touching] = request[Touching]; this._addDone(finalizedRequest); this._triggerSubscriptions(finalizedRequest); } diff --git a/packages/store/addon/-private/ts-interfaces/identifier.ts b/packages/store/addon/-private/ts-interfaces/identifier.ts index 1600fb9289f..1ce497640d9 100644 --- a/packages/store/addon/-private/ts-interfaces/identifier.ts +++ b/packages/store/addon/-private/ts-interfaces/identifier.ts @@ -1,15 +1,14 @@ /** @module @ember-data/store */ -import { symbol } from '../utils/symbol'; import type { ExistingResourceObject, ResourceIdentifierObject } from './ember-data-json-api'; export type ResourceData = ResourceIdentifierObject | ExistingResourceObject; export type IdentifierBucket = 'record'; // provided for additional debuggability -export const DEBUG_CLIENT_ORIGINATED: unique symbol = symbol('record-originated-on-client'); -export const DEBUG_IDENTIFIER_BUCKET: unique symbol = symbol('identifier-bucket'); +export const DEBUG_CLIENT_ORIGINATED: unique symbol = Symbol('record-originated-on-client'); +export const DEBUG_IDENTIFIER_BUCKET: unique symbol = Symbol('identifier-bucket'); export interface Identifier { lid: string; diff --git a/packages/store/addon/-private/utils/symbol.ts b/packages/store/addon/-private/utils/symbol.ts deleted file mode 100644 index f067529150c..00000000000 --- a/packages/store/addon/-private/utils/symbol.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - @module @ember-data/store -*/ - -/** - * This symbol provides a Symbol replacement for browsers that do not have it - * (eg. IE 11). - * - * The replacement is different from the native Symbol in some ways. It is a - * function that produces an output: - * - iterable; - * - that is a string, not a symbol. - * - * @internal - */ -export const symbol = - typeof Symbol !== 'undefined' - ? Symbol - : (key: string) => `__${key}${Math.floor(Math.random() * Date.now())}__` as any; - -export function addSymbol(obj: object, symbol: Symbol | string, value: any): void { - if (typeof symbol === 'string') { - Object.defineProperty(obj, symbol, { - value, - configurable: false, - enumerable: false, - writable: false, - }); - } else { - // Typescript doesn't allow Symbol as an index type - obj[symbol as unknown as string] = value; - } -} diff --git a/packages/unpublished-test-infra/addon-test-support/qunit-asserts/assert-deprecation.ts b/packages/unpublished-test-infra/addon-test-support/qunit-asserts/assert-deprecation.ts index 77dba4c608d..b4e4cab645e 100644 --- a/packages/unpublished-test-infra/addon-test-support/qunit-asserts/assert-deprecation.ts +++ b/packages/unpublished-test-infra/addon-test-support/qunit-asserts/assert-deprecation.ts @@ -1,5 +1,3 @@ -import './utils/symbol-ponyfill'; - import { registerDeprecationHandler } from '@ember/debug'; import { VERSION } from '@ember/version'; import { DEBUG } from '@glimmer/env'; diff --git a/packages/unpublished-test-infra/addon-test-support/qunit-asserts/utils/symbol-ponyfill.ts b/packages/unpublished-test-infra/addon-test-support/qunit-asserts/utils/symbol-ponyfill.ts deleted file mode 100644 index dbe53b27c0d..00000000000 --- a/packages/unpublished-test-infra/addon-test-support/qunit-asserts/utils/symbol-ponyfill.ts +++ /dev/null @@ -1,6 +0,0 @@ -const d = Date.now(); -function FakeSymbol(str: string): string { - return `symbol:${d}-${str}`; -} - -window.Symbol = typeof window.Symbol !== 'undefined' ? window.Symbol : (FakeSymbol as unknown as SymbolConstructor); diff --git a/tsconfig.json b/tsconfig.json index 7deff6d2ad8..585bc9287d5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -35,7 +35,6 @@ "packages/store/tests/dummy/app/config/environment.d.ts", "packages/store/tests/dummy/app/app.ts", "packages/store/addon/index.ts", - "packages/store/addon/-private/utils/symbol.ts", "packages/store/addon/-private/utils/promise-record.ts", "packages/store/addon/-private/utils/is-non-empty-string.ts", "packages/store/addon/-private/utils/construct-resource.ts", From 5bc3eae9a93feb8bfd1ec9a2fb75323d982a6c21 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Fri, 5 Nov 2021 12:37:50 -0500 Subject: [PATCH 4/7] Remove IE11 hacks (#7741) * Remove IE11 hacks * rm plugin-transform-block-scoping --- .../integration/store/model-name-test.js | 2 -- .../src/stripped-build-plugins.js | 3 +-- .../integration/graph/edge-removal/setup.ts | 7 +----- .../-private/identifiers/utils/uuid-v4.ts | 13 ----------- .../store/addon/-private/system/core-store.ts | 22 ++++++++----------- .../-private/system/model/internal-model.ts | 16 +++++--------- .../addon/-private/system/store/finders.js | 12 +++------- 7 files changed, 20 insertions(+), 55 deletions(-) diff --git a/packages/-ember-data/tests/integration/store/model-name-test.js b/packages/-ember-data/tests/integration/store/model-name-test.js index 37c1db0d335..d703aa6b783 100644 --- a/packages/-ember-data/tests/integration/store/model-name-test.js +++ b/packages/-ember-data/tests/integration/store/model-name-test.js @@ -65,8 +65,6 @@ module('@ember-data/model klass.modelName', function (hooks) { startsWith(e.message, `Cannot assign to read only property 'modelName' of `) || // Firefox has a different message startsWith(e.message, `"modelName" is read-only`) || - // IE11 has a different message - startsWith(e.message, `Assignment to read-only properties is not allowed in strict mode`) || // Safari aso has a different message startsWith(e.message, `Attempted to assign to readonly property`), `modelName is immutable: ${e.message}` diff --git a/packages/private-build-infra/src/stripped-build-plugins.js b/packages/private-build-infra/src/stripped-build-plugins.js index 864f3f859dc..fcb0890bc4c 100644 --- a/packages/private-build-infra/src/stripped-build-plugins.js +++ b/packages/private-build-infra/src/stripped-build-plugins.js @@ -2,7 +2,6 @@ const FilterImports = require.resolve('babel-plugin-filter-imports'); const StripClassCallCheck = require.resolve('babel6-plugin-strip-class-callcheck'); -const TransformBlockScoping = require.resolve('@babel/plugin-transform-block-scoping'); function isProduction(environment) { return /production/.test(environment); @@ -22,7 +21,7 @@ module.exports = function (environment, app, compatVersion) { plugins.push([FilterImports, { imports: filteredImports }]); } - plugins.push([TransformBlockScoping, { throwIfClosureRequired: true }], ...DebugMacros); + plugins.push(...DebugMacros); return { plugins, postTransformPlugins }; }; diff --git a/packages/record-data/tests/integration/graph/edge-removal/setup.ts b/packages/record-data/tests/integration/graph/edge-removal/setup.ts index 4f793a339b7..71e0f014d18 100644 --- a/packages/record-data/tests/integration/graph/edge-removal/setup.ts +++ b/packages/record-data/tests/integration/graph/edge-removal/setup.ts @@ -84,13 +84,8 @@ export function isHasMany( return relationship.definition.kind === 'hasMany'; } -// Set.entries() and Set.values() -// ...set and Array.from(set) don't -// work in IE11 function setToArray(set: Set): T[] { - let arr: T[] = []; - set.forEach((v) => arr.push(v)); - return arr; + return Array.from(set); } export function stateOf(rel: BelongsToRelationship | ManyRelationship | ImplicitRelationship): { diff --git a/packages/store/addon/-private/identifiers/utils/uuid-v4.ts b/packages/store/addon/-private/identifiers/utils/uuid-v4.ts index d864176c5dc..162ec7b597c 100644 --- a/packages/store/addon/-private/identifiers/utils/uuid-v4.ts +++ b/packages/store/addon/-private/identifiers/utils/uuid-v4.ts @@ -2,13 +2,6 @@ @module @ember-data/store */ -// support IE11 -declare global { - interface Window { - msCrypto: Crypto; - } -} - const CRYPTO = (() => { const hasWindow = typeof window !== 'undefined'; const isFastBoot = typeof FastBoot !== 'undefined'; @@ -27,12 +20,6 @@ const CRYPTO = (() => { }; } else if (hasWindow && typeof window.crypto !== 'undefined') { return window.crypto; - } else if ( - hasWindow && - typeof window.msCrypto !== 'undefined' && - typeof window.msCrypto.getRandomValues === 'function' - ) { - return window.msCrypto; } else { throw new Error('ember-data: Cannot find a valid way to generate local identifiers'); } diff --git a/packages/store/addon/-private/system/core-store.ts b/packages/store/addon/-private/system/core-store.ts index a8f74c4dd0c..1bb3fc86369 100644 --- a/packages/store/addon/-private/system/core-store.ts +++ b/packages/store/addon/-private/system/core-store.ts @@ -1599,18 +1599,14 @@ abstract class CoreStore extends Service { groups = [snapshots]; } - // we use var here because babel transpiles let - // in a manner that causes a mega-bad perf scenario here - // when targets no longer include IE11 we can drop this. - /* eslint-disable no-var */ - for (var i = 0, l = groups.length; i < l; i++) { - var group = groups[i]; - var totalInGroup = groups[i].length; - var ids = new Array(totalInGroup); - var groupedInternalModels = new Array(totalInGroup); - - for (var j = 0; j < totalInGroup; j++) { - var internalModel = group[j]._internalModel; + for (let i = 0, l = groups.length; i < l; i++) { + let group = groups[i]; + let totalInGroup = groups[i].length; + let ids = new Array(totalInGroup); + let groupedInternalModels = new Array(totalInGroup); + + for (let j = 0; j < totalInGroup; j++) { + let internalModel = group[j]._internalModel; groupedInternalModels[j] = internalModel; ids[j] = internalModel.id; @@ -1627,7 +1623,7 @@ abstract class CoreStore extends Service { }); })(groupedInternalModels); } else if (ids.length === 1) { - var pair = seeking[groupedInternalModels[0].id]; + let pair = seeking[groupedInternalModels[0].id]; _fetchRecord(pair); } else { assert("You cannot return an empty array from adapter's method groupRecordsForFindMany"); diff --git a/packages/store/addon/-private/system/model/internal-model.ts b/packages/store/addon/-private/system/model/internal-model.ts index d80ae68a625..4f17e896950 100644 --- a/packages/store/addon/-private/system/model/internal-model.ts +++ b/packages/store/addon/-private/system/model/internal-model.ts @@ -1455,15 +1455,11 @@ export function extractRecordDataFromRecord(recordOrPromiseRecord) { } function anyUnloaded(store: CoreStore, relationship: ManyRelationship) { - // Can't use `find` because of IE11 and these arrays are potentially massive let state = relationship.currentState; - let unloaded = false; - for (let i = 0; i < state.length; i++) { - let im = store._internalModelForResource(state[i]); - if (im._isDematerializing || !im.currentState.isLoaded) { - unloaded = true; - break; - } - } - return unloaded; + const unloaded = state.find((s) => { + let im = store._internalModelForResource(s); + return im._isDematerializing || !im.currentState.isLoaded; + }); + + return unloaded || false; } diff --git a/packages/store/addon/-private/system/store/finders.js b/packages/store/addon/-private/system/store/finders.js index a666ed27090..092b3f96767 100644 --- a/packages/store/addon/-private/system/store/finders.js +++ b/packages/store/addon/-private/system/store/finders.js @@ -273,18 +273,12 @@ function fixRelationshipData(relationshipData, relationshipKind, { id, modelName if (relationshipKind === 'hasMany') { payload = relationshipData || []; if (relationshipData) { - // IE11 does not support array.find // these arrays could be massive so this is better than filter // Note: this is potentially problematic if type/id are not in the // same state of normalization. - let found = false; - for (let i = 0; i < relationshipData.length; i++) { - let v = relationshipData[i]; - if (v.type === parentRelationshipData.type && v.id === parentRelationshipData.id) { - found = true; - break; - } - } + let found = relationshipData.find((v) => { + return v.type === parentRelationshipData.type && v.id === parentRelationshipData.id; + }); if (!found) { payload.push(parentRelationshipData); } From b25160cc43843b6e4105a729825e95951b2fdccf Mon Sep 17 00:00:00 2001 From: Darius D Date: Sat, 13 Nov 2021 05:09:54 -0600 Subject: [PATCH 5/7] Add dependency caching to CI workflows (#7729) Co-authored-by: Scott Newcomer --- .github/workflows/alpha-release.yml | 2 ++ .github/workflows/asset-size-check.yml | 1 + .github/workflows/main.yml | 11 +++++++++++ .github/workflows/nightly.yml | 2 ++ 4 files changed, 16 insertions(+) diff --git a/.github/workflows/alpha-release.yml b/.github/workflows/alpha-release.yml index f6011e7866c..82c82dd8680 100644 --- a/.github/workflows/alpha-release.yml +++ b/.github/workflows/alpha-release.yml @@ -18,6 +18,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies for master run: yarn install --frozen-lockfile --non-interactive - name: Basic Tests @@ -37,6 +38,7 @@ jobs: with: registry-url: 'https://registry.npmjs.org' node-version: 14.x + cache: 'yarn' - name: Install dependencies for master run: yarn install --frozen-lockfile --non-interactive - name: Make sure git user is setup diff --git a/.github/workflows/asset-size-check.yml b/.github/workflows/asset-size-check.yml index 988f1f0d6a0..5a9ad16774e 100644 --- a/.github/workflows/asset-size-check.yml +++ b/.github/workflows/asset-size-check.yml @@ -15,6 +15,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Check SHA run: | sha=$(git rev-parse --short=8 HEAD) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad07976aa69..d3b17f8a381 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Yarn install run: yarn --frozen-lockfile - name: Lint features @@ -38,6 +39,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Yarn install run: yarn --frozen-lockfile - name: Yarn test infra compatWith 3.0 @@ -73,6 +75,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies run: yarn install --frozen-lockfile --network-timeout=300000 - name: Launcher Info @@ -135,6 +138,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies run: yarn install --frozen-lockfile --network-timeout=300000 - name: Fastboot Test ${{ matrix.scenario }} @@ -165,6 +169,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies run: yarn install --frozen-lockfile --network-timeout=300000 - name: Launcher Info @@ -187,6 +192,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies w/o lockfile run: yarn install --no-lockfile --non-interactive - name: Basic Tests @@ -204,6 +210,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies run: yarn install - name: Basic tests with ${{ matrix.scenario }} @@ -234,6 +241,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies run: yarn install - name: Basic tests with ${{ matrix.release }} @@ -260,6 +268,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies run: yarn install --frozen-lockfile --network-timeout=300000 - name: Basic tests with ${{ matrix.scenario }} @@ -280,6 +289,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} + cache: 'yarn' - name: Install dependencies w/o lockfile run: yarn install --no-lockfile --non-interactive - name: Basic Tests @@ -325,6 +335,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies run: yarn install - name: Generate package tarballs diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index dc04f133ab3..ba80caf4ddd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,6 +12,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies for master run: yarn install - name: Basic Tests @@ -36,6 +37,7 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 14.x + cache: 'yarn' - name: Install dependencies for ${{ matrix.scenario }} run: yarn install - name: Basic Tests From 5264ad150a12a2702218556a5748bbd46a2de231 Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Wed, 17 Nov 2021 10:56:11 -0800 Subject: [PATCH 6/7] Cancel older CI jobs (#7760) --- .github/workflows/asset-size-check.yml | 4 ++++ .github/workflows/enforce-pr-labels-beta.yml | 5 +++++ .github/workflows/enforce-pr-labels-canary.yml | 5 +++++ .github/workflows/enforce-pr-labels-lts-prev.yml | 7 ++++++- .github/workflows/enforce-pr-labels-lts.yml | 7 ++++++- .github/workflows/enforce-pr-labels-old-release.yml | 5 +++++ .github/workflows/enforce-pr-labels-release.yml | 5 +++++ .github/workflows/main.yml | 8 ++++++-- .github/workflows/perf-check.yml | 4 ++++ 9 files changed, 46 insertions(+), 4 deletions(-) diff --git a/.github/workflows/asset-size-check.yml b/.github/workflows/asset-size-check.yml index 5a9ad16774e..e5e07dd667b 100644 --- a/.github/workflows/asset-size-check.yml +++ b/.github/workflows/asset-size-check.yml @@ -5,6 +5,10 @@ on: branches: - master +concurrency: + group: asset-size-${{ github.head_ref }} + cancel-in-progress: true + jobs: asset-size-check: runs-on: ubuntu-latest diff --git a/.github/workflows/enforce-pr-labels-beta.yml b/.github/workflows/enforce-pr-labels-beta.yml index 86ff615c323..76608e924a5 100644 --- a/.github/workflows/enforce-pr-labels-beta.yml +++ b/.github/workflows/enforce-pr-labels-beta.yml @@ -5,6 +5,11 @@ on: types: [labeled, unlabeled, opened, reopened, edited, synchronize] branches: - beta + +concurrency: + group: pr-labels-beta-${{ github.head_ref }} + cancel-in-progress: true + jobs: enforce-changelog-label: runs-on: ubuntu-latest diff --git a/.github/workflows/enforce-pr-labels-canary.yml b/.github/workflows/enforce-pr-labels-canary.yml index 2e530ec1c10..3bcd73df7eb 100644 --- a/.github/workflows/enforce-pr-labels-canary.yml +++ b/.github/workflows/enforce-pr-labels-canary.yml @@ -5,6 +5,11 @@ on: types: [labeled, unlabeled, opened, reopened, edited, synchronize] branches: - master + +concurrency: + group: pr-labels-canary-${{ github.head_ref }} + cancel-in-progress: true + jobs: enforce-changelog-label: runs-on: ubuntu-latest diff --git a/.github/workflows/enforce-pr-labels-lts-prev.yml b/.github/workflows/enforce-pr-labels-lts-prev.yml index 18f90d79298..2e5fc6984c4 100644 --- a/.github/workflows/enforce-pr-labels-lts-prev.yml +++ b/.github/workflows/enforce-pr-labels-lts-prev.yml @@ -4,7 +4,12 @@ on: pull_request: types: [labeled, unlabeled, opened, reopened, edited, synchronize] branches: - - lts-3-20 + - lts-3-24 + +concurrency: + group: pr-labels-lts-prev-${{ github.head_ref }} + cancel-in-progress: true + jobs: enforce-changelog-label: runs-on: ubuntu-latest diff --git a/.github/workflows/enforce-pr-labels-lts.yml b/.github/workflows/enforce-pr-labels-lts.yml index 143257edc62..3ec7210565b 100644 --- a/.github/workflows/enforce-pr-labels-lts.yml +++ b/.github/workflows/enforce-pr-labels-lts.yml @@ -4,7 +4,12 @@ on: pull_request: types: [labeled, unlabeled, opened, reopened, edited, synchronize] branches: - - lts-3-24 + - lts-3-28 + +concurrency: + group: pr-labels-lts-${{ github.head_ref }} + cancel-in-progress: true + jobs: enforce-changelog-label: runs-on: ubuntu-latest diff --git a/.github/workflows/enforce-pr-labels-old-release.yml b/.github/workflows/enforce-pr-labels-old-release.yml index 1d36569e6cf..a5a46ee85df 100644 --- a/.github/workflows/enforce-pr-labels-old-release.yml +++ b/.github/workflows/enforce-pr-labels-old-release.yml @@ -5,6 +5,11 @@ on: types: [labeled, unlabeled, opened, reopened, edited, synchronize] branches: - release-* + +concurrency: + group: pr-labels-old-release-${{ github.head_ref }} + cancel-in-progress: true + jobs: enforce-changelog-label: runs-on: ubuntu-latest diff --git a/.github/workflows/enforce-pr-labels-release.yml b/.github/workflows/enforce-pr-labels-release.yml index 63af75a11ac..f82fc823e06 100644 --- a/.github/workflows/enforce-pr-labels-release.yml +++ b/.github/workflows/enforce-pr-labels-release.yml @@ -5,6 +5,11 @@ on: types: [labeled, unlabeled, opened, reopened, edited, synchronize] branches: - release + +concurrency: + group: pr-labels-release-${{ github.head_ref }} + cancel-in-progress: true + jobs: enforce-changelog-label: runs-on: ubuntu-latest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3b17f8a381..bdf195c5d03 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,10 @@ on: tags: - '*' +concurrency: + group: ci-${{ github.head_ref }} + cancel-in-progress: true + jobs: lint: timeout-minutes: 5 @@ -142,12 +146,12 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile --network-timeout=300000 - name: Fastboot Test ${{ matrix.scenario }} - timeout-minutes: 12 + timeout-minutes: 12 run: yarn test:fastboot ${{ matrix.scenario }} browser-tests: needs: [lint] - timeout-minutes: 20 + timeout-minutes: 20 strategy: fail-fast: false matrix: diff --git a/.github/workflows/perf-check.yml b/.github/workflows/perf-check.yml index 20364d62ff5..8a5f6ec770e 100644 --- a/.github/workflows/perf-check.yml +++ b/.github/workflows/perf-check.yml @@ -5,6 +5,10 @@ on: branches: - master +concurrency: + group: perf-${{ github.head_ref }} + cancel-in-progress: true + jobs: performance-checks: name: 'Performance Checks' From 87299125a84005d1d5e4764daff4640b5ebbc5da Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Fri, 17 Sep 2021 10:26:32 -0500 Subject: [PATCH 7/7] Fix hanging store.destroy testt (#7703) --- packages/-ember-data/tests/integration/store-test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/-ember-data/tests/integration/store-test.js b/packages/-ember-data/tests/integration/store-test.js index 78637538335..5262634f5f8 100644 --- a/packages/-ember-data/tests/integration/store-test.js +++ b/packages/-ember-data/tests/integration/store-test.js @@ -181,8 +181,11 @@ module('integration/store - destroy', function (hooks) { // to flush, potentially pushing data into the store await settled(); assert.ok(true, 'we made it to the end'); - await requestPromise; - assert.ok(false, 'we should never make it here'); + requestPromise.then(() => { + assert.ok(false, 'we should never make it here'); + }); + + await settled(); }); test('destroying the store correctly cleans everything up', async function (assert) {