-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(@aws-amplify/ui-react): Export CJS #5324
fix(@aws-amplify/ui-react): Export CJS #5324
Conversation
…'allowSyntheticDefaultImports' flag'
// tsconfig for ESM generating | ||
let compilerOptions = { | ||
esModuleInterop: true, |
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.
Without this, import React from "react"
results in:
Cannot read property 'Component' of undefined
Codecov Report
@@ Coverage Diff @@
## master #5324 +/- ##
=======================================
Coverage 72.90% 72.90%
=======================================
Files 195 195
Lines 11466 11466
Branches 2157 2157
=======================================
Hits 8359 8359
Misses 2956 2956
Partials 151 151 Continue to review full report at Codecov.
|
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
@@ -148,9 +148,14 @@ function reportWatchStatusChanged(diagnostic, newLine, options, errorCount) { | |||
} | |||
|
|||
async function buildES5(typeScriptCompiler) { | |||
const jsx = packageInfo.name === 'aws-amplify-react' ? 'react' : undefined; | |||
const jsx = ['@aws-amplify/ui-react', 'aws-amplify-react'].includes( |
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.
Do we have includes
in our library? I believe we are using find but just want to make sure there are no build errors with using this.
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.
Array.prototype.includes
has been in since Node 6, and it works locally & in CI.
If there's another aspect I'm unaware of, I'm happy to swap it to .find
.
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.
.find
is what we use now, I believe it was something on the polyfill piece of it. @manueliglesias Do you have any clarity on this?
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.
AS per our offline, I am fine. Approving
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 pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Issue #, if available: #5322
Stencil's demo project didn't transpile CJS. This PR re-uses much of
aws-amplify-react
.See commits for history.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.