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

Add browser field to package.json for frontend use #1065

Merged
merged 2 commits into from May 3, 2024

Conversation

campbellwmorgan
Copy link
Contributor

  • The browser-shim works nicely when trying to share code between
    frontend and backend, however manual overrides can be tricky
  • Many build systems (including webpack) will take the script from
    the browser field simplifying this process

* The `browser-shim` works nicely when trying to share code between
  frontend and backend, however manual overrides can be tricky
* Many build systems (including webpack) will take the script from
  the `browser` field simplifying this process
@MichalLytek MichalLytek added Community 👨‍👧 Something initiated by a community Enhancement 🆕 New feature or request labels Oct 17, 2021
@MichalLytek MichalLytek self-requested a review October 17, 2021 08:20
@itpropro
Copy link

itpropro commented Jan 9, 2022

Any updates here @MichalLytek? I know its a small change, but it would help me fixing this in many projects and for the future.

@MichalLytek
Copy link
Owner

I'm not convinced about this.

TypeGraphQL can also normally work on frontend (e.g. https://github.com/MichalLytek/type-graphql/tree/master/examples/apollo-client). And looks like with this change, bundlers will start using shim instead of the real package 😕

@ibilux
Copy link

ibilux commented Nov 3, 2022

I'm not convinced about this.

TypeGraphQL can also normally work on frontend (e.g. https://github.com/MichalLytek/type-graphql/tree/master/examples/apollo-client). And looks like with this change, bundlers will start using shim instead of the real package confused

It does not work on framework like SvelteKit for frontend (but it does work for backend).

@ibilux
Copy link

ibilux commented Nov 4, 2022

This PR fixed the problem in SvelteKit !

@MichalLytek
Copy link
Owner

@campbellwmorgan
I've updated your branch with recent master and updated the entry to match the new build folders introduced by #1400.
Thanks for your contribution! ❤️

Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.50%. Comparing base (be33fd4) to head (426a096).
Report is 23 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1065   +/-   ##
=======================================
  Coverage   95.50%   95.50%           
=======================================
  Files         113      113           
  Lines        1847     1847           
  Branches      364      326   -38     
=======================================
  Hits         1764     1764           
  Misses         83       83           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MichalLytek MichalLytek merged commit 0b1c728 into MichalLytek:master May 3, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community 👨‍👧 Something initiated by a community Enhancement 🆕 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants