]> git.ipfire.org Git - thirdparty/vuejs/core.git/commit
perf: support only attaching slot scope ids when necessary
authorEvan You <yyx990803@gmail.com>
Fri, 5 Mar 2021 17:12:49 +0000 (12:12 -0500)
committerEvan You <yyx990803@gmail.com>
Fri, 5 Mar 2021 23:28:12 +0000 (18:28 -0500)
commit02cbbb718ca226b087c42e6f132120931307c2a6
tree84d8be3b4d691ae24f5eda1618c36a82e19c1cfe
parentf74b16ccfe42abddf6abfa6105900ad9b8124a96
perf: support only attaching slot scope ids when necessary

This is done by adding the `slotted: false` option to:

- compiler-dom
- compiler-ssr
- compiler-sfc (forwarded to template compiler)

At runtime, only slotted component will render slot fragments with
slot scope Ids. For SSR, only slotted component will add slot scope Ids
to rendered slot content. This should improve both runtime performance
and reduce SSR rendered markup size.

Note: requires SFC tooling (e.g. `vue-loader` and `vite`) to pass on
the `slotted` option from the SFC descriptoer to the `compileTemplate`
call.
packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts
packages/compiler-core/src/options.ts
packages/compiler-core/src/transform.ts
packages/compiler-core/src/transforms/transformSlotOutlet.ts
packages/compiler-sfc/__tests__/parse.spec.ts
packages/compiler-sfc/src/compileTemplate.ts
packages/compiler-sfc/src/parse.ts
packages/compiler-ssr/__tests__/ssrSlotOutlet.spec.ts
packages/compiler-ssr/src/transforms/ssrTransformSlotOutlet.ts
packages/runtime-core/__tests__/scopeId.spec.ts
packages/runtime-core/src/helpers/renderSlot.ts