From a227050ed0637d261c4d9fe2bec63dadc666c2e6 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Wed, 8 May 2024 20:15:15 +0800 Subject: [PATCH] chore: update babel repo (#3205) --- .github/actions/clone-submodules/action.yml | 2 +- justfile | 2 +- tasks/coverage/codegen_babel.snap | 4 +-- tasks/coverage/codegen_sourcemap.snap | 6 +++- tasks/coverage/parser_babel.snap | 22 +++++++++++++-- tasks/coverage/prettier_babel.snap | 4 +-- tasks/coverage/transformer_babel.snap | 4 +-- tasks/transform_conformance/babel.snap.md | 29 ++++++++++---------- tasks/transform_conformance/src/test_case.rs | 7 +---- 9 files changed, 48 insertions(+), 32 deletions(-) diff --git a/.github/actions/clone-submodules/action.yml b/.github/actions/clone-submodules/action.yml index 2136b8ab29..a0a5781a0c 100644 --- a/.github/actions/clone-submodules/action.yml +++ b/.github/actions/clone-submodules/action.yml @@ -15,7 +15,7 @@ runs: with: repository: babel/babel path: tasks/coverage/babel - ref: acf3d17fdfe150a270c822581b709dddac4548ce + ref: 4bd1b2c2f1bb3f702cfcb50448736e33c7000128 - uses: actions/checkout@v4 with: diff --git a/justfile b/justfile index 3295f205d9..fd89d47504 100755 --- a/justfile +++ b/justfile @@ -27,7 +27,7 @@ ready: # Clone or update submodules submodules: just clone-submodule tasks/coverage/test262 git@github.com:tc39/test262.git 17ba9aea47e496f5b2bc6ce7405b3f32e3cfbf7a - just clone-submodule tasks/coverage/babel git@github.com:babel/babel.git acf3d17fdfe150a270c822581b709dddac4548ce + just clone-submodule tasks/coverage/babel git@github.com:babel/babel.git 4bd1b2c2f1bb3f702cfcb50448736e33c7000128 just clone-submodule tasks/coverage/typescript git@github.com:microsoft/TypeScript.git 64d2eeea7b9c7f1a79edf42cb99f302535136a2e just clone-submodule tasks/prettier_conformance/prettier git@github.com:prettier/prettier.git 7142cf354cce2558f41574f44b967baf11d5b603 diff --git a/tasks/coverage/codegen_babel.snap b/tasks/coverage/codegen_babel.snap index 047b6d3470..eb16bff175 100644 --- a/tasks/coverage/codegen_babel.snap +++ b/tasks/coverage/codegen_babel.snap @@ -1,3 +1,3 @@ codegen_babel Summary: -AST Parsed : 2097/2097 (100.00%) -Positive Passed: 2097/2097 (100.00%) +AST Parsed : 2099/2099 (100.00%) +Positive Passed: 2099/2099 (100.00%) diff --git a/tasks/coverage/codegen_sourcemap.snap b/tasks/coverage/codegen_sourcemap.snap index 7a446788bb..a5966c2289 100644 --- a/tasks/coverage/codegen_sourcemap.snap +++ b/tasks/coverage/codegen_sourcemap.snap @@ -47,7 +47,7 @@ Expected a semicolon or an implicit semicolon after a statement, but found none -- bar-record-tuple/input.js +- bar-record-tuple-babel-7/input.js Unexpected token @@ -410,6 +410,10 @@ Unexpected token Invalid Character `[` +- hash-record-tuple-babel-7/input.js +Invalid Character `[` + + - react.development.js (9:0-11:0) "\n'use strict';\n" --> (0:0-1:0) "'use strict';" (11:0-11:4) "\nif " --> (1:0-1:4) "\nif " diff --git a/tasks/coverage/parser_babel.snap b/tasks/coverage/parser_babel.snap index 67f964b039..1c62393b19 100644 --- a/tasks/coverage/parser_babel.snap +++ b/tasks/coverage/parser_babel.snap @@ -1,6 +1,6 @@ parser_babel Summary: -AST Parsed : 2091/2097 (99.71%) -Positive Passed: 2084/2097 (99.38%) +AST Parsed : 2091/2099 (99.62%) +Positive Passed: 2084/2099 (99.29%) Negative Passed: 1363/1501 (90.81%) Expect Syntax Error: "annex-b/disabled/1.1-html-comments-close/input.js" Expect Syntax Error: "annex-b/disabled/3.1-sloppy-labeled-functions/input.js" @@ -163,6 +163,24 @@ Expect to Parse: "typescript/arrow-function/generic-tsx-babel-7/input.ts" ╭─[typescript/arrow-function/generic-tsx-babel-7/input.ts:3:1] 2 │ (a: T): T => a; ╰──── +Expect to Parse: "typescript/assign/TSTypeParameterInstantiation/input.ts" + + × Unexpected token + ╭─[typescript/assign/TSTypeParameterInstantiation/input.ts:15:31] + 14 │ + 15 │ cls.myFunc = (instance) => { + · ─ + 16 │ console.log(instance.myField); + ╰──── +Expect to Parse: "typescript/assign/TSTypeParameterInstantiation-babel-7/input.ts" + + × Unexpected token + ╭─[typescript/assign/TSTypeParameterInstantiation-babel-7/input.ts:15:31] + 14 │ + 15 │ cls.myFunc = (instance) => { + · ─ + 16 │ console.log(instance.myField); + ╰──── Expect to Parse: "typescript/class/constructor-with-modifier-names/input.ts" × Multiple constructor implementations are not allowed. diff --git a/tasks/coverage/prettier_babel.snap b/tasks/coverage/prettier_babel.snap index 1928b36d0c..7a4c6a868b 100644 --- a/tasks/coverage/prettier_babel.snap +++ b/tasks/coverage/prettier_babel.snap @@ -1,6 +1,6 @@ prettier_babel Summary: -AST Parsed : 2097/2097 (100.00%) -Positive Passed: 1891/2097 (90.18%) +AST Parsed : 2099/2099 (100.00%) +Positive Passed: 1893/2099 (90.19%) Expect to Parse: "comments/attachComment-false/array-expression-trailing-comma/input.js" Expect to Parse: "comments/basic/array-expression-trailing-comma/input.js" Expect to Parse: "comments/basic/object-expression-trailing-comma/input.js" diff --git a/tasks/coverage/transformer_babel.snap b/tasks/coverage/transformer_babel.snap index 70f588b7ff..622e43be5f 100644 --- a/tasks/coverage/transformer_babel.snap +++ b/tasks/coverage/transformer_babel.snap @@ -1,3 +1,3 @@ transformer_babel Summary: -AST Parsed : 2097/2097 (100.00%) -Positive Passed: 2097/2097 (100.00%) +AST Parsed : 2099/2099 (100.00%) +Positive Passed: 2099/2099 (100.00%) diff --git a/tasks/transform_conformance/babel.snap.md b/tasks/transform_conformance/babel.snap.md index ee724f74be..2476e9fb27 100644 --- a/tasks/transform_conformance/babel.snap.md +++ b/tasks/transform_conformance/babel.snap.md @@ -1,4 +1,4 @@ -Passed: 294/363 +Passed: 294/362 # All Passed: * babel-plugin-transform-react-jsx-source @@ -22,7 +22,7 @@ Passed: 294/363 * opts/optimizeConstEnums/input.ts * opts/rewriteImportExtensions/input.ts -# babel-plugin-transform-typescript (118/155) +# babel-plugin-transform-typescript (118/156) * class/accessor-allowDeclareFields-false/input.ts * class/accessor-allowDeclareFields-true/input.ts * enum/mix-references/input.ts @@ -32,6 +32,7 @@ Passed: 294/363 * exports/export-type-star-from/input.ts * imports/enum-value/input.ts * imports/type-only-export-specifier-2/input.ts +* lvalues/TSTypeParameterInstantiation/input.ts * namespace/ambient-module-nested/input.ts * namespace/ambient-module-nested-exported/input.ts * namespace/canonical/input.ts @@ -75,17 +76,15 @@ Passed: 294/363 * react-source/arrow-function/input.js * react-source/disable-with-super/input.js -# babel-plugin-transform-react-jsx-development (2/14) -* linux/auto-import-dev/input.js -* linux/classic-runtime/input.js -* linux/fragments/input.js -* linux/handle-fragments-with-key/input.js -* linux/handle-nonstatic-children/input.js -* linux/handle-static-children/input.js -* linux/self-inside-arrow/input.mjs -* linux/source-and-self-defined/input.js -* linux/within-derived-classes-constructor/input.js -* linux/within-ts-module-block/input.ts -* windows/auto-import-dev-windows/input.js -* windows/classic-runtime-windows/input.js +# babel-plugin-transform-react-jsx-development (2/12) +* cross-platform/auto-import-dev/input.js +* cross-platform/classic-runtime/input.js +* cross-platform/fragments/input.js +* cross-platform/handle-fragments-with-key/input.js +* cross-platform/handle-nonstatic-children/input.js +* cross-platform/handle-static-children/input.js +* cross-platform/self-inside-arrow/input.mjs +* cross-platform/source-and-self-defined/input.js +* cross-platform/within-derived-classes-constructor/input.js +* cross-platform/within-ts-module-block/input.ts diff --git a/tasks/transform_conformance/src/test_case.rs b/tasks/transform_conformance/src/test_case.rs index 5c50870f96..f02ccd575a 100644 --- a/tasks/transform_conformance/src/test_case.rs +++ b/tasks/transform_conformance/src/test_case.rs @@ -11,7 +11,7 @@ use oxc_codegen::{Codegen, CodegenOptions}; use oxc_diagnostics::{miette::miette, Error}; use oxc_parser::Parser; use oxc_span::{SourceType, VALID_EXTENSIONS}; -use oxc_tasks_common::{normalize_path, print_diff_in_terminal, BabelOptions, TestOs}; +use oxc_tasks_common::{normalize_path, print_diff_in_terminal, BabelOptions}; use oxc_transformer::{ ES2015Options, ReactOptions, TransformOptions, Transformer, TypeScriptOptions, }; @@ -130,11 +130,6 @@ pub trait TestCase { fn skip_test_case(&self) -> bool { let options = self.options(); - // Skip windows - if options.os.as_ref().is_some_and(|os| os.iter().any(TestOs::is_windows)) { - return true; - } - // Skip plugins we don't support yet if PLUGINS_NOT_SUPPORTED_YET.iter().any(|plugin| options.get_plugin(plugin).is_some()) { return true;