-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove process auto polyfill in edge runtime (#65751)
### What Disable auto polyfill for process in edge runtime. ### Why React uses process.emit behind a typeof guard now. This leads to process being bundled and process.emit being called which triggers build warnings since we stub process APIs since they're not supported in Edge runtime. There's condition like `"object" === typeof process && "function" === typeof process.emit` in the react build now where the 2nd condition is falsy. Stop polyfilling to skip that condition since it's mainly for Node.js runtime Related to #65692
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react' | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
<p id="process"> | ||
{typeof process === 'object' | ||
? typeof process.emit === 'function' | ||
? 'emit' | ||
: 'object' | ||
: 'undefined'} | ||
</p> | ||
</> | ||
) | ||
} | ||
|
||
export const runtime = 'edge' |