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

Use the prod distribution of React instead of dev in the CDN example #3402

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

kiendang
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 12, 2023

⚠️ No Changeset found

Latest commit: b7b9208

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 12, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: dimaMachina / name: Dimitri POSTOLOV (8fd33be, b7b9208)
  • ✅ login: kiendang / name: Kien Dang (c495e8b)

@acao
Copy link
Member

acao commented Aug 12, 2023

we are already doing this in #3380

@acao
Copy link
Member

acao commented Aug 12, 2023

thanks, though!

@acao acao closed this Aug 12, 2023
@kiendang
Copy link
Contributor Author

Maybe I don't understand it fully, but that PR is for the graphiql-webpack example not the graphiql-cdn example no?

The reason for this PR is there are GraphQL frameworks out there like strawberry and graphene-django that serve GraphiQL and use the CDN example here as reference. Because of this sometimes they just copy paste and ended up shipping with react development which is 10 times the size of production.min.js. Example.

Maybe it's worth changing here too?

@tyranron
Copy link

tyranron commented Jan 31, 2024

@acao ping... I do agree with @kiendang here. Would you mind reconsidering this PR?

@acao
Copy link
Member

acao commented Feb 1, 2024

does https://graphiql-dev.netlify.app/webpack not work? what is the purpose in particular?

@tyranron
Copy link

tyranron commented Feb 1, 2024

@acao it seems to me that @kiendang stated the problem quite clear:

The reason for this PR is there are GraphQL frameworks out there like strawberry and graphene-django that serve GraphiQL and use the CDN example here as reference.

The choice of the graphiql-cdn example is obvious, because they do not want to bother with webpack and/or other toolchains just to serve the GraphiQL page. So, they mostly use it "as is", adjusting it only in few bits to work with the framework, but do not re-check optimality of the dependencies. And then things go viral, because every framework has its users.

Because of this sometimes they just copy paste and ended up shipping with react development which is 10 times the size of production.min.js.

@acao
Copy link
Member

acao commented Feb 1, 2024

oh this is for the cdn example! that makes sense

@acao acao reopened this Feb 1, 2024
@acao
Copy link
Member

acao commented Feb 1, 2024

really, we should be showing how to use <script type="module"> as modern browsers don't need UMD anymore but that's another matter

@kiendang
Copy link
Contributor Author

kiendang commented Feb 8, 2024

Thanks a lot @tyranron for the clarification 👍

@acao let me know if there's anything else needed to get this merged.

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.28%. Comparing base (db6afa9) to head (b7b9208).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           main    #3402       +/-   ##
=========================================
+ Coverage      0   67.28%   +67.28%     
=========================================
  Files         0      121      +121     
  Lines         0     7007     +7007     
  Branches      0     2261     +2261     
=========================================
+ Hits          0     4715     +4715     
- Misses        0     2275     +2275     
- Partials      0       17       +17     

see 121 files with indirect coverage changes

Copy link
Collaborator

@dimaMachina dimaMachina left a comment

Choose a reason for hiding this comment

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

I updated other examples too

@dimaMachina dimaMachina merged commit 2e832f2 into graphql:main Aug 14, 2024
14 checks passed
@kiendang kiendang deleted the react-prod-cdn branch August 14, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants