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

fix: optional access to Reflect.metadata #165

Merged
merged 6 commits into from
Sep 25, 2024

Conversation

sirenkovladd
Copy link
Contributor

πŸ”— Linked issue

#145

❓ Type of change

replace babel-plugin-transform-typescript-metadata

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Replace all call Reflect.metadata with optional call (if not install reflect-metadata)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0
Copy link
Member

pi0 commented Sep 13, 2023

Thanks for this PR i really appreciate it.

Before moving forward with adding a fork, have you considered to make an upstream PR directly to babel?

Also in the meantime, would be nice if we inline the forked version of patch in jiti codebase (same as other plugin forks) but better maintainability.

Adding tests to the fixtures would be also awesome!

@sirenkovladd
Copy link
Contributor Author

I already did this (leonardfactory/babel-plugin-transform-typescript-metadata#70) over a month ago

the last activity in this repository was on March 4, 2022

@sirenkovladd
Copy link
Contributor Author

We can move this repo to the UnJS organization

@pi0
Copy link
Member

pi0 commented Sep 13, 2023

Moving to src/plugins/babel-plugin-transform-typescript-metadata.ts should be doable i guess. let me know if need help on this this.

@sirenkovladd
Copy link
Contributor Author

Do you recommend moving all the code to jiti?

@pi0
Copy link
Member

pi0 commented Sep 13, 2023

Source data only yes. (there are too many repos to maintain in unjs already and i hope we don't need constant update for this until your PR lands upstream -- hopefully)

@sirenkovladd sirenkovladd force-pushed the fix-babel-typescript-metadata branch from 905de19 to b03cf3f Compare September 13, 2023 17:15
@sirenkovladd
Copy link
Contributor Author

One remark, there is a problem with pnpm, I suspect that it is install the types incorrectly
build works only with npm install and not pnpm install
do you have any idea?

@sirenkovladd
Copy link
Contributor Author

Ok, I just hate pnpm lock, it's ok now

@sirenkovladd
Copy link
Contributor Author

@pi0 what do you think about it now?

@pi0
Copy link
Member

pi0 commented Sep 14, 2023

Thanks for the updates! Will check it soon locally πŸ‘πŸΌ

@sirenkovladd
Copy link
Contributor Author

@pi0 hi, how's your check going?

@pi0 pi0 changed the title update package with typescript-metadata fix: optional access to Reflect.metadata Sep 25, 2024
@pi0 pi0 merged commit 87df308 into unjs:main Sep 25, 2024
7 checks passed
@pi0 pi0 mentioned this pull request Sep 25, 2024
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 this pull request may close these issues.

2 participants