diff --git a/CHANGELOG.md b/CHANGELOG.md index 8044f31403..99c17eec3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,11 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ * Fixed errors when using the tree as a functional component `bTree` +#### :house: Internal + +* Create `mono` template in `i-block` for dynamic mono components. It disables +vnode attributes hoisting. + ## v4.0.0-beta.54 (2024-02-06) #### :bug: Bug Fix diff --git a/src/components/super/i-block/CHANGELOG.md b/src/components/super/i-block/CHANGELOG.md index 0942598c0b..f5f0365574 100644 --- a/src/components/super/i-block/CHANGELOG.md +++ b/src/components/super/i-block/CHANGELOG.md @@ -9,6 +9,13 @@ Changelog > - :house: [Internal] > - :nail_care: [Polish] +## v4.0.0-beta.?? (2024-02-??) + +#### :house: Internal + +* Create `mono` template in `i-block` for dynamic mono components. It disables +vnode attributes hoisting. + ## v4.0.0-beta.54 (2024-02-06) #### :bug: Bug Fix diff --git a/src/components/super/i-block/README.md b/src/components/super/i-block/README.md index ed1b102664..313c2a0074 100644 --- a/src/components/super/i-block/README.md +++ b/src/components/super/i-block/README.md @@ -485,6 +485,21 @@ If set to false, the component will generate a special markup to allow it to not - ssrRendering = false ``` +#### [renderMode = `component`] + +If set to `'component'` some optimizations will be applied to hoist vnode attributes. +If your template is used with `v-render` then renderMode must be set to `'mono'` or +you can extend from `mono` template in `i-block` namespace: + +``` +- namespace [%fileName%] + +- include 'components/super/i-block'|b as placeholder + +- template index() extends ['i-block'].mono + /// ... +``` + ### Methods #### slot diff --git a/src/components/super/i-block/i-block.ss b/src/components/super/i-block/i-block.ss index 7aeafd5e6c..307e7b53a5 100644 --- a/src/components/super/i-block/i-block.ss +++ b/src/components/super/i-block/i-block.ss @@ -38,6 +38,14 @@ */ - ssrRendering = true + /** + * Should be set to 'component' for components with runtime, + * for dynamic mono components use 'mono'. + * If set to 'component' some optimizations will be applied to hoist + * vnode attributes. + */ + - renderMode = 'component' + /** * Returns the component name * @param {string} [name] - the custom template name @@ -180,10 +188,16 @@ - else ? rootAttrs[':class'] = value + + - rootClass = {'data-cached-dynamic-class': '["call", "provide.componentClasses", "' + self.name() + '", ["get", "mods"]]'} + + - if renderMode == 'mono' + ? rootClass = {':class': '[...provide.componentClasses("' + self.name() + '", mods)]'} + - rootAttrs = { & class: 'i-block-helper', - 'data-cached-dynamic-class': '["call", "provide.componentClasses", "' + self.name() + '", ["get", "mods"]]', - 'v-async-target': '!ssrRendering' + 'v-async-target': '!ssrRendering', + ...rootClass } . - if teleport @@ -266,3 +280,6 @@ - else += self.renderRootContent() + +- template mono() extends ['i-block'].index + - renderMode = 'mono'