-
Notifications
You must be signed in to change notification settings - Fork 179
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
Don't use node globals in browser context #10487
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swissspidy
added
Type: Code Quality
Things that need a refactor, rewrite or just some good old developer ❤️
Pod: WP & Infra
labels
Feb 7, 2022
swissspidy
force-pushed
the
fix/6304-part-1
branch
2 times, most recently
from
February 7, 2022 10:47
9887a39
to
04ab52c
Compare
swissspidy
force-pushed
the
fix/6304-part-1
branch
from
February 7, 2022 10:57
04ab52c
to
6624bf1
Compare
spacedmonkey
reviewed
Feb 7, 2022
packages/wp-story-editor/src/components/mediaUpload/mediaPicker/WordPressImageCropper.js
Show resolved
Hide resolved
spacedmonkey
reviewed
Feb 7, 2022
packages/wp-story-editor/src/components/mediaUpload/mediaPicker/WordPressImageCropper.js
Show resolved
Hide resolved
spacedmonkey
approved these changes
Feb 7, 2022
samwhale
approved these changes
Feb 7, 2022
Size Change: -19.8 kB (0%) Total Size: 4.06 MB
ℹ️ View Unchanged
|
8 tasks
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Splitting this out from #5792, see #6304 for full context
Summary
Replace usage of
global.*
withwindow.*
webpack v5 no longer polyfills Node.js APIs in the browser, including
global
, which is a Node thing, but webpack has happily supported in the past by making it an alias ofwindow
. Example:global.navigator
becomeswindow.navigator
.Replace usage of
process.env
with custom variableswebpack v5 no longer polyfills Node.js APIs in the browser, including
process
. Uses variables likeWEB_STORIES_ENV
instead ofprocess.env.NODE_ENV
in all frontend code.Relevant Technical Choices
See above
To-do
User-facing changes
None
Testing Instructions
This PR can be tested by following these steps:
Reviews
Does this PR have a security-related impact?
Does this PR change what data or activity we track or use?
Does this PR have a legal-related impact?
Checklist
Type: XYZ
label to the PRPartially addresses #6304