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

[FEATURE] generate Signature in component blueprints #20356

Merged
merged 2 commits into from
Jan 20, 2023

Commits on Jan 19, 2023

  1. [FEATURE] generate signature in component blueprints

    Since [RFC 0748][0748], Glimmer components support a `Signature` type
    which specifies any arguments they accept, any blocks they yield, and
    the element types to which `...attributes` are applied. Incorporate the
    signature when generating TS blueprints for Glimmer components,
    including template-only components. Do *not* generate them for Ember
    (classic) components, since there are severe limitations in using
    classic components that way, and since we only support the Octane
    programming model in our TypeScript support per [RFC 0800][0800].
    
    [0748]: https://rfcs.emberjs.com/id/https://rfcs.emberjs.com/id/0748-glimmer-component-signature/
    [0800]: https://rfcs.emberjs.com/id/https://rfcs.emberjs.com/id/0800-ts-adoption-plan/
    chriskrycho committed Jan 19, 2023
    Configuration menu
    Copy the full SHA
    8f9528e View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2023

  1. Do not include types in JS blueprints

    For the fallback case, where Ember's blueprints are being executed by a
    version of Ember CLI earlier than 4.3.0, the emitted blueprints *must
    not* include any TypeScript types, since the CLI will not be able to
    remove the types. Accordingly:
    
    1.  Return a boolean flag from the `maybePolyfillTypeScriptBlueprints`
        helper, indicating whether the blueprint is in a mode where it can
        reliably *emit* types.
    
    2.  Use that new helper in the component blueprint so that it can avoid
        emitting a signature type, and specifically can avoid emitting it
        as a type parameter on the class or function default export.
    chriskrycho committed Jan 20, 2023
    Configuration menu
    Copy the full SHA
    eebfa28 View commit details
    Browse the repository at this point in the history