Vue-cli: Change default value of TypeScript class-style prompt to false

Created on 1 Jun 2019  路  4Comments  路  Source: vuejs/vue-cli

What problem does this feature solve?

According to the policy of [Abandoned] Class API proposal: Update: the Class API proposal is being dropped. , we should to set the default value to false in the TypeScript prompt Use class-style component syntax?.

What does the proposed API look like?

Change vue-cli/packages/@vue/cli-plugin-typescript/prompts.js as follows:

{
    name: `classComponent`,
    type: `confirm`,
    message: `Use class-style component syntax?`,
    default: false
},

Most helpful comment

vue-class-component will continue to be supported / exist in Vue 3, with decorators just like it works now.

We just don't intend to make a class API without decorators part of Core.

So as vue-class-component still provides the best TS exerience as fas as complete type safety is concerned, it makes sense to keep it as a default.

When Vue 3 arrives, people who want to use the "new way" of using TS would have to migrate their code with either style (class or options object)

All 4 comments

vue-class-component will continue to be supported / exist in Vue 3, with decorators just like it works now.

We just don't intend to make a class API without decorators part of Core.

So as vue-class-component still provides the best TS exerience as fas as complete type safety is concerned, it makes sense to keep it as a default.

When Vue 3 arrives, people who want to use the "new way" of using TS would have to migrate their code with either style (class or options object)

Thank you. I understood very well.
Many people around me are wondering that vue-class-component will not be supported in Vue 3. So I hope your team announce that policy widely.

We mentioned it many times in the RFC discussions both before and after it was abandoned. It's a separate library and was never affected by the RFC.

And still it might be a good idea to communicate this more clearly, I agree. We will get to that.

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments

Gonzalo2683 picture Gonzalo2683  路  3Comments

eladcandroid picture eladcandroid  路  3Comments

wahidrahim picture wahidrahim  路  3Comments

chasegiunta picture chasegiunta  路  3Comments