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

feat(npm/runtime): add decorateMetadata helper function #9189

Merged

Conversation

Dunqing
Copy link
Member

@Dunqing Dunqing commented Feb 18, 2025

Copy link
Member Author

Dunqing commented Feb 18, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Feb 18, 2025
@Dunqing Dunqing changed the title feat(npm/runtime): add decorateMetadata helper function feat(npm/runtime): add decorateMetadata helper function Feb 18, 2025
Copy link
Contributor

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reflect.metadata is not a native JS API. According to TS docs, it requires NPM package https://www.npmjs.com/package/reflect-metadata to "polyfill" this API.

Just checking that we don't need to do anything on our side to insert import 'reflect-metadata'; or something?

I assume the idea is that the user would handle this themselves, but I'm not up to speed on this whole decorator metadata thing, so I just wanted to check.

@Dunqing
Copy link
Member Author

Dunqing commented Feb 19, 2025

Reflect.metadata is not a native JS API. According to TS docs, it requires NPM package https://www.npmjs.com/package/reflect-metadata to "polyfill" this API.

Just checking that we don't need to do anything on our side to insert import 'reflect-metadata'; or something?

I assume the idea is that the user would handle this themselves, but I'm not up to speed on this whole decorator metadata thing, so I just wanted to check.

Yes, we don't need to do anything with reflect-metadata, this usually proceeds by DI Framework like NestJS. NestJS documentation mentioned, that if you want to create a NestJS APP from scratch, you need to manually add a few dependencies one of them is reflect-metadata.

@Dunqing Dunqing force-pushed the 02-18-feat_npm_runtime_add_decoratemetadata_helper_function branch from 086a176 to 2ad0f09 Compare February 19, 2025 07:15
@Dunqing Dunqing force-pushed the 02-12-feat_transformer_decorator_support_emitting_decorator_metadata branch from e58bd9b to a2aad51 Compare February 19, 2025 07:15
@overlookmotel
Copy link
Contributor

Great. Thanks for explaining.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 19, 2025
Copy link

graphite-app bot commented Feb 19, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 02-12-feat_transformer_decorator_support_emitting_decorator_metadata branch from a2aad51 to 90ba283 Compare February 19, 2025 14:05
@graphite-app graphite-app bot force-pushed the 02-18-feat_npm_runtime_add_decoratemetadata_helper_function branch from 2ad0f09 to 6c24357 Compare February 19, 2025 14:05
Base automatically changed from 02-12-feat_transformer_decorator_support_emitting_decorator_metadata to main February 19, 2025 14:11
@graphite-app graphite-app bot merged commit 6c24357 into main Feb 19, 2025
16 checks passed
@graphite-app graphite-app bot deleted the 02-18-feat_npm_runtime_add_decoratemetadata_helper_function branch February 19, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants