Subscribe on changes!

Allow fully-disabling {{interpolation}}

avatar
Feb 11th 2022

What problem does this feature solve?

For projects that only use Vue a little, or in very specific ways to just enhance pages, I would love if there was an option to disable {{ interpolation }} globally or per-app if you know you aren't going to use it.

This is specifically for both security and performance. If you know you aren't going to use this feature, turn it completely off.

I know we can already set app.compilerOptions.delimiters to something we won't use, but I assume this still causes framework code to run checking for your delimiters each template

I believe old versions of Vue used to have an option like this somewhere

What does the proposed API look like?

app.compilerOptions.interpolation = false;

createApp({
  compilerOptions: {
    interpolation: false
  }
});
avatar
Feb 11th 2022

I believe old versions of Vue used to have an option like this somewhere

Nope.

And I don't think we want to offer one now. The use case for this seems to tiny I don't think we should put that on our list of things to maintain.

avatar
Feb 11th 2022

I believe old versions of Vue used to have an option like this somewhere

Nope.

Is that not what interpolate: true used to control here? https://012.vuejs.org/api/global-api.html

avatar
Feb 11th 2022

Oh, I wasn't think as a far back as pre-official 1.0 😄

Vue's focus has changed a lot since then, so my position doesn't change.

avatar
Feb 11th 2022

v-pre doesn't satisfy the use-case here, we still want to use Vue features to enhance components, just not {{interpolation}} specifically

I understand if you don't think this request is widely useful or worth maintaining, regardless