Skip to content

[Feature Request] Please provide template optimizationsΒ #720

Open
@Maxim-Mazurok

Description

🧐 Problem Description

As mentioned in vuejs/rfcs#388, I'd love to see template optimization with hoisting static elements.

πŸ’» Sample code

Here's an example from https://vuejs.org/guide/extras/rendering-mechanism.html#static-hoisting,

You can see on the left - .vue compiled uses hoisting. On the right - TSX/JSX compiled - doesn't use hoisting, both using the same source.

image

<div>
  <div>foo</div>
  <div>bar</div>
  <div>{dynamic}</div>
</div>

πŸš‘ Other information

I have tried to use vueJsx({ optimize: true }) from @vitejs/plugin-vue-jsx which I believe uses this plugin and passes this option to it, but it didn't affect results. So I'm assuming this has not been implemented yet. Looking forward to it, thanks!

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions