Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: explicit set useDefineForClassFields in ts templates #4280

Merged
merged 1 commit into from
Aug 26, 2021

Commits on Jul 14, 2021

  1. feat: explicit set useDefineForClassFields in ts templates

    Since TypeScript 4.3, `target: "esnext"` indicates that
    `useDefineForClassFields: true` as the new default.
    See <microsoft/TypeScript#42663>
    
    So I'm explicitly adding this field to the tsconfigs to avoid any
    confusions.
    
    Note that `lit-element` projects must use
    `useDefineForClassFields: false` because of <https://github.com/lit/lit-element/issues/1030>
    
    Vue projects must use `useDefineForClassFields: true` so as to support
    class style `prop` definition in `vue-class-component`:
    <vuejs/vue-class-component#465>
    
    Popular React state management library MobX requires it to be `true`:
    <https://mobx.js.org/installation.html#use-spec-compliant-transpilation-for-class-properties>
    
    Other frameworks seem to have no particular opinion on this.
    
    So I turned it on in all templates except for the `lit-element` one.
    haoqunjiang committed Jul 14, 2021
    Configuration menu
    Copy the full SHA
    d4a1f35 View commit details
    Browse the repository at this point in the history