-
Notifications
You must be signed in to change notification settings - Fork 820
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: improve instanceof checks to support custom transformers #9970
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9970 +/- ##
==========================================
+ Coverage 54.17% 54.21% +0.04%
==========================================
Files 835 834 -1
Lines 46117 46068 -49
Branches 9839 9835 -4
==========================================
- Hits 24982 24975 -7
+ Misses 19144 19105 -39
+ Partials 1991 1988 -3
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
packages/amplify-graphql-transformer-core/src/cdk-compat/file-asset.ts
Outdated
Show resolved
Hide resolved
This commit updates two instanceof checks to instead check the constructor name. This is done to better support custom transformers. Because custom transformers import/require potentially different copies of the transformer modules, the instanceof checks do not work. This required v2 custom transformers to rely on NODE_PATH hacks and other workarounds. Refs: #9362
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This commit updates two
instanceof
checks to instead checkthe constructor name. This is done to better support custom
transformers. Because custom transformers
import
/require
potentially different copies of the transformer modules,
the
instanceof
checks do not work. This required v2 customtransformers to rely on
NODE_PATH
hacks and otherworkarounds.
Fixes: #9362