From d5b8c6677b26447c2bffca2ad3f2a11c16880e60 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:05:56 +0000 Subject: [PATCH 1/7] chore: fix typos --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- packages/vue-compat/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index fe5e82b04a4..11853cec30c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -30,7 +30,7 @@ body: description: | The easiest way to provide a reproduction is by showing the bug in [The SFC Playground](https://sfc.vuejs.org/). If it cannot be reproduced in the playground and requires a proper build setup, try [StackBlitz](https://vite.new/vue). - If neither of these are suitable, you can always provide a GitHub reporistory. + If neither of these are suitable, you can always provide a GitHub repository. The reproduction should be **minimal** - i.e. it should contain only the bare minimum amount of code needed to show the bug. See [Bug Reproduction Guidelines](https://github.com/vuejs/core/blob/main/.github/bug-repro-guidelines.md) for more details. diff --git a/packages/vue-compat/README.md b/packages/vue-compat/README.md index 0bc84b33402..23e4ce9ebcc 100644 --- a/packages/vue-compat/README.md +++ b/packages/vue-compat/README.md @@ -311,7 +311,7 @@ Features that start with `COMPILER_` are compiler-specific: if you are using the | V_ON_KEYCODE_MODIFIER | ✔ | `v-on` no longer supports keyCode modifiers | [link](https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html) | | CUSTOM_DIR | ✔ | Custom directive hook names changed | [link](https://v3-migration.vuejs.org/breaking-changes/custom-directives.html) | | ATTR_FALSE_VALUE | ✔ | No longer removes attribute if binding value is boolean `false` | [link](https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html) | -| ATTR_ENUMERATED_COERSION | ✔ | No longer special case enumerated attributes | [link](https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html) | +| ATTR_ENUMERATED_COERCION | ✔ | No longer special case enumerated attributes | [link](https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html) | | TRANSITION_GROUP_ROOT | ✔ | `` no longer renders a root element by default | [link](https://v3-migration.vuejs.org/breaking-changes/transition-group.html) | | COMPONENT_ASYNC | ✔ | Async component API changed (now requires `defineAsyncComponent`) | [link](https://v3-migration.vuejs.org/breaking-changes/async-components.html) | | COMPONENT_FUNCTIONAL | ✔ | Functional component API changed (now must be plain functions) | [link](https://v3-migration.vuejs.org/breaking-changes/functional-components.html) | From 87abcaa64ec73500c5edb806465a0c70774ad2b4 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:10:00 +0000 Subject: [PATCH 2/7] augmentor -> argument --- packages/compiler-core/src/transform.ts | 2 +- packages/compiler-core/src/transforms/vOn.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/compiler-core/src/transform.ts b/packages/compiler-core/src/transform.ts index 6397df92f3c..913d0956c71 100644 --- a/packages/compiler-core/src/transform.ts +++ b/packages/compiler-core/src/transform.ts @@ -59,7 +59,7 @@ export type DirectiveTransform = ( context: TransformContext, // a platform specific compiler can import the base transform and augment // it by passing in this optional argument. - augmentor?: (ret: DirectiveTransformResult) => DirectiveTransformResult + argument?: (ret: DirectiveTransformResult) => DirectiveTransformResult ) => DirectiveTransformResult export interface DirectiveTransformResult { diff --git a/packages/compiler-core/src/transforms/vOn.ts b/packages/compiler-core/src/transforms/vOn.ts index a9dfe77eff7..e407988176d 100644 --- a/packages/compiler-core/src/transforms/vOn.ts +++ b/packages/compiler-core/src/transforms/vOn.ts @@ -33,7 +33,7 @@ export const transformOn: DirectiveTransform = ( dir, node, context, - augmentor + argument ) => { const { loc, modifiers, arg } = dir as VOnDirectiveNode if (!dir.exp && !modifiers.length) { @@ -163,9 +163,9 @@ export const transformOn: DirectiveTransform = ( ] } - // apply extended compiler augmentor - if (augmentor) { - ret = augmentor(ret) + // apply extended compiler argument + if (argument) { + ret = argument(ret) } if (shouldCache) { From b03e5abd26e8a813258a9640139b7b7a7940280b Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:16:49 +0000 Subject: [PATCH 3/7] tempalte -> template --- packages/compiler-sfc/__tests__/compileScript.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-sfc/__tests__/compileScript.spec.ts b/packages/compiler-sfc/__tests__/compileScript.spec.ts index 08d404b9c16..f7a796949a9 100644 --- a/packages/compiler-sfc/__tests__/compileScript.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript.spec.ts @@ -471,7 +471,7 @@ defineExpose({ foo: 123 }) `) }) }) From f0685c60aa24fafdf689ae7f449432e74cc8ac87 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:20:35 +0000 Subject: [PATCH 4/7] coomments -> comments --- packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts b/packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts index 6cbb0d3a956..44b113c68be 100644 --- a/packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts +++ b/packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts @@ -37,7 +37,7 @@ describe('ssr: attrs fallthrough', () => { `) }) - test('fallthrough component content (root with coomments)', () => { + test('fallthrough component content (root with comments)', () => { expect(compile(`
`).code) .toMatchInlineSnapshot(` "const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"vue/server-renderer\\") From b72f09e769e073fc8b60d1b4f23ed7e3641a6993 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:25:16 +0000 Subject: [PATCH 5/7] Cocerced -> Coerced --- packages/runtime-dom/src/modules/attrs.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/runtime-dom/src/modules/attrs.ts b/packages/runtime-dom/src/modules/attrs.ts index a80936345ed..41648ed50dc 100644 --- a/packages/runtime-dom/src/modules/attrs.ts +++ b/packages/runtime-dom/src/modules/attrs.ts @@ -53,23 +53,23 @@ export function compatCoerceAttr( instance: ComponentInternalInstance | null = null ): boolean { if (isEnumeratedAttr(key)) { - const v2CocercedValue = + const v2CoercedValue = value === null ? 'false' : typeof value !== 'boolean' && value !== undefined ? 'true' : null if ( - v2CocercedValue && + v2CoercedValue && compatUtils.softAssertCompatEnabled( DeprecationTypes.ATTR_ENUMERATED_COERCION, instance, key, value, - v2CocercedValue + v2CoercedValue ) ) { - el.setAttribute(key, v2CocercedValue) + el.setAttribute(key, v2CoercedValue) return true } } else if ( From ca29819e1f2d2befb1c3962d9ed3467a2b8e1d27 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Tue, 20 Sep 2022 20:13:05 +0800 Subject: [PATCH 6/7] Revert --- packages/compiler-core/src/transform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-core/src/transform.ts b/packages/compiler-core/src/transform.ts index 913d0956c71..6397df92f3c 100644 --- a/packages/compiler-core/src/transform.ts +++ b/packages/compiler-core/src/transform.ts @@ -59,7 +59,7 @@ export type DirectiveTransform = ( context: TransformContext, // a platform specific compiler can import the base transform and augment // it by passing in this optional argument. - argument?: (ret: DirectiveTransformResult) => DirectiveTransformResult + augmentor?: (ret: DirectiveTransformResult) => DirectiveTransformResult ) => DirectiveTransformResult export interface DirectiveTransformResult { From b91af96efb629837ec4df22502f0bfa08dce4204 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Tue, 20 Sep 2022 20:13:27 +0800 Subject: [PATCH 7/7] Revert --- packages/compiler-core/src/transforms/vOn.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/compiler-core/src/transforms/vOn.ts b/packages/compiler-core/src/transforms/vOn.ts index e407988176d..a9dfe77eff7 100644 --- a/packages/compiler-core/src/transforms/vOn.ts +++ b/packages/compiler-core/src/transforms/vOn.ts @@ -33,7 +33,7 @@ export const transformOn: DirectiveTransform = ( dir, node, context, - argument + augmentor ) => { const { loc, modifiers, arg } = dir as VOnDirectiveNode if (!dir.exp && !modifiers.length) { @@ -163,9 +163,9 @@ export const transformOn: DirectiveTransform = ( ] } - // apply extended compiler argument - if (argument) { - ret = argument(ret) + // apply extended compiler augmentor + if (augmentor) { + ret = augmentor(ret) } if (shouldCache) {