From eb0b774eeafbf4d18f6b07a6a9fe2fba7a0e0740 Mon Sep 17 00:00:00 2001 From: Rishabh Jain Date: Thu, 29 Jul 2021 02:56:24 +0000 Subject: [PATCH 1/7] TEST: Run CI on Dart 2.13 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d96a2bcb..bae2f68d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM drydock-prod.workiva.net/workiva/dart_build_image:1 +FROM drydock-prod.workiva.net/workiva/dart_build_image:0.0.0-dart2.13.4-2 # Chrome install adapted from https://github.com/Workiva/dart_unit_test_image/blob/master@%7B13-01-2021%7D/Dockerfile RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ From b61bc863a9154cda0ad39ab2498930ad5a2c80bf Mon Sep 17 00:00:00 2001 From: Rob Becker Date: Wed, 11 Aug 2021 17:20:56 -0600 Subject: [PATCH 2/7] avoid meta 1.7.0 --- pubspec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 050d2154..3d3623f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,15 +3,15 @@ version: 6.0.1 description: Bindings of the ReactJS library for building interactive interfaces. homepage: https://github.com/cleandart/react-dart environment: - sdk: '>=2.7.0 <3.0.0' + sdk: '>=2.9.0 <3.0.0' dependencies: js: ^0.6.0 - meta: ^1.1.6 + meta: ">=1.2.2 <1.7.0" dev_dependencies: args: ^1.5.1 build_runner: ^1.6.5 build_test: ^0.10.8 - build_web_compilers: ^2.1.4 + build_web_compilers: ^2.12.0 dependency_validator: ^1.2.0 matcher: ^0.12.5 mockito: ^4.1.1 From 4b72b1f798956fc727cb611052832b0408a7bf7b Mon Sep 17 00:00:00 2001 From: Rob Becker Date: Wed, 11 Aug 2021 17:38:25 -0600 Subject: [PATCH 3/7] format --- test/lifecycle_test/util.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/lifecycle_test/util.dart b/test/lifecycle_test/util.dart index 068f67b9..d6d3d47d 100644 --- a/test/lifecycle_test/util.dart +++ b/test/lifecycle_test/util.dart @@ -40,7 +40,11 @@ mixin LifecycleTestHelper on Component { 'context': context, }); - var lifecycleCallback = props == null ? staticProps == null ? null : staticProps[memberName] : props[memberName]; + var lifecycleCallback = props == null + ? staticProps == null + ? null + : staticProps[memberName] + : props[memberName]; if (lifecycleCallback != null) { return Function.apply( lifecycleCallback, From 9b6c051bc684bf578e763e14d171f19f3055e244 Mon Sep 17 00:00:00 2001 From: Rob Becker Date: Wed, 11 Aug 2021 20:56:26 -0600 Subject: [PATCH 4/7] assume Dart SDK >=2.9.3, remove workarounds --- .github/workflows/dart_ci.yml | 8 ++--- Dockerfile | 55 ----------------------------------- js_src/dart_env_dev.js | 7 ----- pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 68 deletions(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index 877a68f1..c3a56b1c 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -30,11 +30,9 @@ jobs: run: dart pub run dependency_validator -i build_runner,build_test,build_web_compilers,meta if: always() && steps.install.outcome == 'success' - # TODO: Uncomment this, and remove the Dart 2.7.2 format step in the Workiva Build Dockerfile - # once we are able to bump the lower bound of SDK. -# - name: Verify formatting -# run: dart format --output=none --line-length=120 --set-exit-if-changed . -# if: always() && ${{ matrix.sdk }} == 'stable' && steps.install.outcome == 'success' + - name: Verify formatting + run: dart format --output=none --line-length=120 --set-exit-if-changed . + if: always() && ${{ matrix.sdk }} == 'stable' && steps.install.outcome == 'success' - name: Analyze project source run: dart analyze diff --git a/Dockerfile b/Dockerfile index bae2f68d..c35f1b5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,56 +1 @@ -FROM drydock-prod.workiva.net/workiva/dart_build_image:0.0.0-dart2.13.4-2 - -# Chrome install adapted from https://github.com/Workiva/dart_unit_test_image/blob/master@%7B13-01-2021%7D/Dockerfile -RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ - echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \ - apt-get -qq update && apt-get install -y google-chrome-stable && \ - mv /usr/bin/google-chrome-stable /usr/bin/google-chrome && \ - sed -i --follow-symlinks -e 's/\"\$HERE\/chrome\"/\"\$HERE\/chrome\" --no-sandbox/g' /usr/bin/google-chrome - -# TODO: Remove this and instead run it within the github actions CI on the stable channel once SDK lower bound is >=2.9.3 -RUN dartfmt --line-length=120 --dry-run --set-exit-if-changed . - -# TODO: Remove these test runs once SDK lower bound is >=2.9.3 -RUN pub run build_runner test --release -- --preset dart2js --exclude-tags=dart-2-7-dart2js-variadic-issues -RUN pub run build_runner test -- --preset dartdevc - -# We need 2.9.2 to verify the Chrome MemoryInfo workaround: https://github.com/cleandart/react-dart/pull/280 -# TODO remove the workaround as well as this config once SDK lower bound is >=2.9.3 -FROM google/dart:2.9.2 -RUN dart --version - -# Don't allow the dart package to be updated via apt -RUN apt-mark hold dart - -# Update image - required by aviary -RUN apt-get update -qq && \ - apt-get dist-upgrade -y && \ - apt-get autoremove -y && \ - apt-get clean all -# Install deps for Chrome install -RUN apt-get install -y \ - build-essential \ - curl \ - git \ - make \ - parallel \ - wget \ - && rm -rf /var/lib/apt/lists/* - -# Chrome install adapted from https://github.com/Workiva/dart_unit_test_image/blob/master@%7B13-01-2021%7D/Dockerfile -RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ - echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \ - apt-get -qq update && apt-get install -y google-chrome-stable && \ - mv /usr/bin/google-chrome-stable /usr/bin/google-chrome && \ - sed -i --follow-symlinks -e 's/\"\$HERE\/chrome\"/\"\$HERE\/chrome\" --no-sandbox/g' /usr/bin/google-chrome - -WORKDIR /build/ -ADD . /build/ - -RUN pub get -# Run DDC tests to verify Chrome workaround -RUN pub run build_runner test -- --preset dartdevc -# Run dart2js tests that fail in 2.7 -RUN pub run build_runner test --release -- --preset dart2js --tags=dart-2-7-dart2js-variadic-issues - FROM scratch diff --git a/js_src/dart_env_dev.js b/js_src/dart_env_dev.js index b62d03cb..625cd69b 100644 --- a/js_src/dart_env_dev.js +++ b/js_src/dart_env_dev.js @@ -1,12 +1,5 @@ React.__isDevelopment = true; -if (typeof window.MemoryInfo == "undefined") { - if (typeof window.performance.memory != "undefined") { - window.MemoryInfo = function () {}; - window.MemoryInfo.prototype = window.performance.memory.__proto__; - } -} - // Intercept console.warn calls and prevent excessive warnings in DDC-compiled code // when type-checking event handlers (function types that include SyntheticEvent classes). // diff --git a/pubspec.yaml b/pubspec.yaml index 4d58b986..01f857f3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ version: 6.1.0 description: Bindings of the ReactJS library for building interactive interfaces. homepage: https://github.com/cleandart/react-dart environment: - sdk: '>=2.9.0 <3.0.0' + sdk: '>=2.9.3 <3.0.0' dependencies: js: ^0.6.0 meta: ">=1.1.6 <1.7.0" # Workaround to avoid https://github.com/dart-lang/sdk/issues/46142 From 66cd83986dd22b46d477d0fe47b2152f2eaa00e7 Mon Sep 17 00:00:00 2001 From: Kirk Richardson Date: Mon, 30 Aug 2021 12:01:35 -0600 Subject: [PATCH 5/7] Lower SDK constraint --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 08281aa0..7c5e4b6e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ version: 6.1.1 description: Bindings of the ReactJS library for building interactive interfaces. homepage: https://github.com/cleandart/react-dart environment: - sdk: '>=2.9.3 <3.0.0' + sdk: '>=2.7.0 <3.0.0' dependencies: js: ^0.6.0 meta: ">=1.1.6 <1.7.0" # Workaround to avoid https://github.com/dart-lang/sdk/issues/46142 From 615ece7c3d2af3982c6ba052fc07aa896693b29f Mon Sep 17 00:00:00 2001 From: evanweible-wf Date: Mon, 30 Aug 2021 15:17:22 -0600 Subject: [PATCH 6/7] Run pub get during build --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index c35f1b5f..6465a503 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1,4 @@ +FROM google/dart:2.13 +COPY pubspec.yaml . +RUN dart pub get FROM scratch From 7f06447c521c257ea430aa8c3d3c9c61d565dcd9 Mon Sep 17 00:00:00 2001 From: evanweible-wf Date: Mon, 30 Aug 2021 15:17:30 -0600 Subject: [PATCH 7/7] Re-add Chrome 86 workaround --- js_src/dart_env_dev.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js_src/dart_env_dev.js b/js_src/dart_env_dev.js index 625cd69b..b62d03cb 100644 --- a/js_src/dart_env_dev.js +++ b/js_src/dart_env_dev.js @@ -1,5 +1,12 @@ React.__isDevelopment = true; +if (typeof window.MemoryInfo == "undefined") { + if (typeof window.performance.memory != "undefined") { + window.MemoryInfo = function () {}; + window.MemoryInfo.prototype = window.performance.memory.__proto__; + } +} + // Intercept console.warn calls and prevent excessive warnings in DDC-compiled code // when type-checking event handlers (function types that include SyntheticEvent classes). //