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

Preserve used imports when interoperating with transform-typescript #32

Merged
merged 5 commits into from
Nov 1, 2023

Commits on Aug 31, 2023

  1. TS transform interop

    `@babel/plugin-transform-typescript` removes unused imports because it assumes they're types (yuck). That's how TS behaves so it's at least understandable.
    
    However, it doesn't seem to respect the fact that our plugin is *emitting* code that *will* use the imports.
    
    This adds a failing test.
    ef4 committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    df22c9e View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2023

  1. Configuration menu
    Copy the full SHA
    ef3abe4 View commit details
    Browse the repository at this point in the history
  2. simplify

    patricklx authored Oct 27, 2023
    Configuration menu
    Copy the full SHA
    addacaa View commit details
    Browse the repository at this point in the history
  3. fix

    patricklx authored Oct 27, 2023
    Configuration menu
    Copy the full SHA
    46c0a74 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2023

  1. Preserve imports used within templates

    Builds off #31 to fix #30.
    
    Instead of keeping *everything* as in #31 (which is not safe in general), we use the `pre` to take a snapshot of available imports and then only when we discover that a template wants to use a name that is not in scope do we check if it was in the original set of available imports and reintroduce an import for it.
    ef4 committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    3d9f9d4 View commit details
    Browse the repository at this point in the history