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: #4311 Update main entry field to point to CJS builds instead of … #4678

Merged
merged 1 commit into from
Jan 8, 2020

Conversation

Amplifiyer
Copy link
Contributor

…webpack bundles

Issue #, if available: fixes: #4311 #4499

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov
Copy link

codecov bot commented Jan 7, 2020

Codecov Report

Merging #4678 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4678   +/-   ##
=======================================
  Coverage   76.29%   76.29%           
=======================================
  Files         174      174           
  Lines        9628     9628           
  Branches     1965     1965           
=======================================
  Hits         7346     7346           
  Misses       2137     2137           
  Partials      145      145

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a811091...f2546c6. Read the comment docs.

Copy link
Contributor

@ericclemmons ericclemmons left a comment

Choose a reason for hiding this comment

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

Trying to figure out how to best validate it:

• Jest's auto-mocking bug (#4499)
• Confirm that a production build of CRA with latest vs. #4678 yields the same size.
• Since the ./index.js entry-point is no longer referenced, does that mean we lose the process.env.NODE_ENV === "production") behavior?

The way I've validated package-publishing changes like these in the past was by publishing 0.0.0-f2546c6 (or similar) for consumption in stand-alone projects.

How would you recommend validation? The usual yarn build/link?

@Amplifiyer
Copy link
Contributor Author

Jest's auto-mocking bug (#4499)

Verified locally that this PR fixes the mocking issue with @aws-amplify/auth in #4499

Confirm that a production build of CRA with latest vs. #4678 yields the same size.

CRA app with latest amplify version

  500.75 KB          build/static/js/2.0357ba12.chunk.js
  3.65 KB            build/static/css/2.a1f9020b.chunk.css
  1.1 KB             build/static/js/main.4d3758ea.chunk.js
  762 B              build/static/js/runtime~main.a8a9905a.js
  523 B              build/static/css/main.f5532a38.chunk.css

CRA app with this PR changes

  500.82 KB (+63 B)  build/static/js/2.aae62737.chunk.js
  3.65 KB            build/static/css/2.a1f9020b.chunk.css
  1.09 KB (-2 B)     build/static/js/main.d877e69f.chunk.js
  762 B              build/static/js/runtime~main.a8a9905a.js
  523 B              build/static/css/main.f5532a38.chunk.css

Since the ./index.js entry-point is no longer referenced, does that mean we lose the process.env.NODE_ENV === "production") behavior?

Yes, it'll only be applicable to users who are explicitly depending on the root index.js. If we feel it's no longer important we can even delete the index.js and figure out a better way to publish the webpack bundles.

Copy link
Contributor

@ericclemmons ericclemmons left a comment

Choose a reason for hiding this comment

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

@Amplifiyer Thanks for the validation, and great work on getting this put together so quickly! 🎉

As far as I know, the value in process.env.NODE_ENV is for gating dev-only behavior (e.g. React's warnings and stricter checks) when not in production, and for clearer stack-traces when a bug occurs within our source.

For now, I believe this PR is a step forward for our customers and we can address the bundling and we can handle these quality-of-life separately.

@Amplifiyer Amplifiyer merged commit 54fbdf4 into aws-amplify:master Jan 8, 2020
manueliglesias added a commit to manueliglesias/aws-amplify that referenced this pull request Jan 30, 2020
This fix reverts our environment checks to a previous version that worked fine, but failed under certain curcustances now fixed (see aws-amplify#4678)

The solution using `new Function'return this')()` caused problems when using CSP
manueliglesias added a commit that referenced this pull request Jan 30, 2020
* fix(@aws-amplify/core): Revert environment checks

This fix reverts our environment checks to a previous version that worked fine, but failed under certain curcustances now fixed (see #4678)

The solution using `new Function'return this')()` caused problems when using CSP

* Make node tests use cjs instead of umd
Ashish-Nanda pushed a commit to Ashish-Nanda/amplify-js that referenced this pull request Feb 12, 2020
* fix(@aws-amplify/core): Revert environment checks

This fix reverts our environment checks to a previous version that worked fine, but failed under certain curcustances now fixed (see aws-amplify#4678)

The solution using `new Function'return this')()` caused problems when using CSP

* Make node tests use cjs instead of umd
@github-actions
Copy link

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 *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQLError: adapter is not a function Next.js getInitialProps
2 participants