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

Typescript plugin transformers API design is incompatible with angular compiler #1667

Open
Haringat opened this issue Jan 22, 2024 · 1 comment · May be fixed by #1668
Open

Typescript plugin transformers API design is incompatible with angular compiler #1667

Haringat opened this issue Jan 22, 2024 · 1 comment · May be fixed by #1668

Comments

@Haringat
Copy link

  • Rollup Plugin Name: typescript
  • Rollup Plugin Version: 11.1.6

Expected Behavior / Situation

I would like to use the NgTscPlugin from @angular/compiler-cli to create transformers for @rollup/plugin-typescript. NgTscPlugin#createTransformers seems to have exactly the return type that the rollup plugin can use.

Actual Behavior / Situation

In order to call createTransformers, I have to have called setupCompilation, which needs a program, which is only available inside the factory method of a program transformer. So I would need to be inside a transformer to create the transformers.

Modification Proposal

If possible, it would be nice to have the transformers configuration option be a callback that is provided with a program (and maybe even a compilerhost?) and returns the transformers object.

@Haringat Haringat changed the title Typescript transformers API design is incompatible with angular compiler Typescript plugin transformers API design is incompatible with angular compiler Jan 22, 2024
@shellscape
Copy link
Collaborator

Thanks for the issue. This isn't likely to see any traction unless there's a contribution from the community. Mostly because, well Angular, but also bc this is an Angular specific problem whereas we don't have the issue with the majority of frameworks (otherwise we'd have a flood of issues about it)

@Haringat Haringat linked a pull request Jan 24, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants