swc icon indicating copy to clipboard operation
swc copied to clipboard

Drop `print()` API from `@swc/core`

Open kdy1 opened this issue 6 months ago • 3 comments

It's causing too many issues

  • The memory leak of parse is due to the existence of codegen() API
  • We do not have good usecase for it.

kdy1 avatar Jun 05 '25 17:06 kdy1

Do you mean this one?

https://github.com/swc-project/swc/blob/main/packages/core/src/index.ts#L450

I'd like to help. Should I send a PR for removing this?

cseas avatar Jun 13 '25 15:06 cseas

Yeap, but I need to figure out a way to

  • deprecate it, while supporting it for v1
  • remove the feature from v2
  • publish v2 as nightly

kdy1 avatar Jun 13 '25 15:06 kdy1

Maybe cut out a new branch for v1?

For example: https://github.com/TanStack/query/

Image

This can help maintain v1 separately in the future if patch releases need to be made.

cseas avatar Jun 13 '25 17:06 cseas