From 13a96050652e205b3e0e6992269e42c53fe80daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jo=C3=A3o=20melo?= Date: Sun, 21 Mar 2021 16:26:54 -0300 Subject: [PATCH 1/5] proposoal of 'allow listing' as an inclusive alternative to 'whitelisting' --- src/guide/migration/custom-elements-interop.md | 4 ++-- src/guide/migration/introduction.md | 2 +- src/guide/template-syntax.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/guide/migration/custom-elements-interop.md b/src/guide/migration/custom-elements-interop.md index afc1f88b5b..d0ddc24a1e 100644 --- a/src/guide/migration/custom-elements-interop.md +++ b/src/guide/migration/custom-elements-interop.md @@ -7,7 +7,7 @@ badges: ## Overview -- **BREAKING:** Custom elements whitelisting is now performed during template compilation, and should be configured via compiler options instead of runtime config. +- **BREAKING:** Custom elements allow listing is now performed during template compilation, and should be configured via compiler options instead of runtime config. - **BREAKING:** Special `is` prop usage is restricted to the reserved `` tag only. - **NEW:** There is new `v-is` directive to support 2.x use cases where `is` was used on native elements to work around native HTML parsing restrictions. @@ -21,7 +21,7 @@ If we want to add a custom element defined outside of Vue (e.g. using the Web Co ### 2.x Syntax -In Vue 2.x, whitelisting tags as custom elements was done via `Vue.config.ignoredElements`: +In Vue 2.x, allow listing tags as custom elements was done via `Vue.config.ignoredElements`: ```js // This will make Vue ignore custom element defined outside of Vue diff --git a/src/guide/migration/introduction.md b/src/guide/migration/introduction.md index c9a0d0300f..f0d46d7ff0 100644 --- a/src/guide/migration/introduction.md +++ b/src/guide/migration/introduction.md @@ -89,7 +89,7 @@ The following consists a list of breaking changes from 2.x: ### Custom Elements -- [Custom elements whitelisting is now performed during template compilation](/guide/migration/custom-elements-interop.html) +- [Custom elements allow listing is now performed during template compilation](/guide/migration/custom-elements-interop.html) - [Special `is` prop usage is restricted to the reserved `` tag only](/guide/migration/custom-elements-interop.html#customized-built-in-elements) ### Other Minor Changes diff --git a/src/guide/template-syntax.md b/src/guide/template-syntax.md index ca460876c0..e33fc589db 100644 --- a/src/guide/template-syntax.md +++ b/src/guide/template-syntax.md @@ -206,4 +206,4 @@ Unless you have a "someattr" property in your instance, your code won't work. #### JavaScript Expressions -Template expressions are sandboxed and only have access to a [whitelist of globals](https://github.com/vuejs/vue-next/blob/master/packages/shared/src/globalsWhitelist.ts#L3) such as `Math` and `Date`. You should not attempt to access user defined globals in template expressions. +Template expressions are sandboxed and only have access to a [allowlist of globals](https://github.com/vuejs/vue-next/blob/master/packages/shared/src/globalsWhitelist.ts#L3) such as `Math` and `Date`. You should not attempt to access user defined globals in template expressions. From 493ecf827a35cedec1a92ba4670c144559e61ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jo=C3=A3o=20melo?= Date: Mon, 22 Mar 2021 13:06:54 -0300 Subject: [PATCH 2/5] Update src/guide/migration/introduction.md Co-authored-by: skirtle <65301168+skirtles-code@users.noreply.github.com> --- src/guide/migration/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/migration/introduction.md b/src/guide/migration/introduction.md index f0d46d7ff0..21258e2011 100644 --- a/src/guide/migration/introduction.md +++ b/src/guide/migration/introduction.md @@ -89,7 +89,7 @@ The following consists a list of breaking changes from 2.x: ### Custom Elements -- [Custom elements allow listing is now performed during template compilation](/guide/migration/custom-elements-interop.html) +- [Custom element checks are now performed during template compilation](/guide/migration/custom-elements-interop.html) - [Special `is` prop usage is restricted to the reserved `` tag only](/guide/migration/custom-elements-interop.html#customized-built-in-elements) ### Other Minor Changes From d69367d630b954e2f0a418aa3ecc97e09b0d7879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jo=C3=A3o=20melo?= Date: Mon, 22 Mar 2021 13:07:18 -0300 Subject: [PATCH 3/5] Update src/guide/migration/custom-elements-interop.md Co-authored-by: skirtle <65301168+skirtles-code@users.noreply.github.com> --- src/guide/migration/custom-elements-interop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/migration/custom-elements-interop.md b/src/guide/migration/custom-elements-interop.md index d0ddc24a1e..c66ad51da6 100644 --- a/src/guide/migration/custom-elements-interop.md +++ b/src/guide/migration/custom-elements-interop.md @@ -21,7 +21,7 @@ If we want to add a custom element defined outside of Vue (e.g. using the Web Co ### 2.x Syntax -In Vue 2.x, allow listing tags as custom elements was done via `Vue.config.ignoredElements`: +In Vue 2.x, configuring tags as custom elements was done via `Vue.config.ignoredElements`: ```js // This will make Vue ignore custom element defined outside of Vue From 09af36b63026ba5fbb5a376a585fab760b9af6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jo=C3=A3o=20melo?= Date: Mon, 22 Mar 2021 13:07:38 -0300 Subject: [PATCH 4/5] Update src/guide/template-syntax.md Co-authored-by: skirtle <65301168+skirtles-code@users.noreply.github.com> --- src/guide/template-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/template-syntax.md b/src/guide/template-syntax.md index e33fc589db..9b2c55a555 100644 --- a/src/guide/template-syntax.md +++ b/src/guide/template-syntax.md @@ -206,4 +206,4 @@ Unless you have a "someattr" property in your instance, your code won't work. #### JavaScript Expressions -Template expressions are sandboxed and only have access to a [allowlist of globals](https://github.com/vuejs/vue-next/blob/master/packages/shared/src/globalsWhitelist.ts#L3) such as `Math` and `Date`. You should not attempt to access user defined globals in template expressions. +Template expressions are sandboxed and only have access to a [restricted list of globals](https://github.com/vuejs/vue-next/blob/master/packages/shared/src/globalsWhitelist.ts#L3) such as `Math` and `Date`. You should not attempt to access user defined globals in template expressions. From abf37af0382f5cb03b58bceb4a0c0b6e22d8a2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jo=C3=A3o=20melo?= Date: Mon, 22 Mar 2021 15:27:08 -0300 Subject: [PATCH 5/5] Update src/guide/migration/custom-elements-interop.md Co-authored-by: skirtle <65301168+skirtles-code@users.noreply.github.com> --- src/guide/migration/custom-elements-interop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/migration/custom-elements-interop.md b/src/guide/migration/custom-elements-interop.md index c66ad51da6..1135dc87ab 100644 --- a/src/guide/migration/custom-elements-interop.md +++ b/src/guide/migration/custom-elements-interop.md @@ -7,7 +7,7 @@ badges: ## Overview -- **BREAKING:** Custom elements allow listing is now performed during template compilation, and should be configured via compiler options instead of runtime config. +- **BREAKING:** The checks to determine whether tags should be treated as custom elements are now performed during template compilation, and should be configured via compiler options instead of runtime config. - **BREAKING:** Special `is` prop usage is restricted to the reserved `` tag only. - **NEW:** There is new `v-is` directive to support 2.x use cases where `is` was used on native elements to work around native HTML parsing restrictions.