-
Notifications
You must be signed in to change notification settings - Fork 185
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
Importable version of reflect-metadata
that does not shim globals.
#130
Comments
Easiest and most obviously relevant test, not at all SES specific, would be Object.isExtensible(Reflect) if the answer is |
Wasn't the problem that errors were reported after Checking extensibility is easy enough, but I'm not sure it would help. I'm also not sure if just checking for the presence of My biggest concern with how I'm wary that changing the current behavior to one that prevents metadata mutation on frozen objects could be a breaking change, but perhaps there is a way I could lock down the metadata API in response to a call to SES's I've started on a |
Major breaking change to what, precisely? After you introduce |
I was considering whether it would be feasible to fix the main module in some fashion rather than adding a |
Hi @rbuckton any progress on this? |
I need a metadata reflection package that works today with current versions of TS and without introducing unsupported features into the language. I'll try my hand at building and publishing something. |
Related:
The various APIs added to
Reflect
byreflect-metadata
are incompatible with SES. One option is to introduce an "importable" version that can still work with TypeScript's--emitDecoratorMetadata
option:This version of
Reflect
would wrap the built-in globalReflect
object so that existing TypeScript emit for the__metadata
helper can continue to work while allowing access to globalReflect
functionality.@erights: Unfortunately, I cannot change the default behavior of the main module without it being a major breaking change. Is it possible to detect whether code is running in an SES environment so as not to attempt mutation of the global
Reflect
? If that's the case, I could investigate a hybrid approach that still performed shimming when non in an SES environment, but also provided exports for the various methods.The text was updated successfully, but these errors were encountered: