-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Packages: Stop using Node.js built-ins in browser-packaged code #13386
Copy link
Copy link
Closed
Labels
Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first timeNeeds DevReady for, and needs developer effortsReady for, and needs developer efforts[Type] TaskIssues or PRs that have been broken down into an individual action to takeIssues or PRs that have been broken down into an individual action to takenpm PackagesRelated to npm packagesRelated to npm packages
Metadata
Metadata
Assignees
Labels
Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first timeNeeds DevReady for, and needs developer effortsReady for, and needs developer efforts[Type] TaskIssues or PRs that have been broken down into an individual action to takeIssues or PRs that have been broken down into an individual action to takenpm PackagesRelated to npm packagesRelated to npm packages
Type
Fields
Give feedbackNo fields configured for issues without a type.
We should seek to move away from referencing Node.js built-ins from modules, e.g.
import { parse } from 'url';, where'url'is a reference to a browser-compatible variant of the Nodeurlmodule.Reasons include:
qsin the@wordpress/urlpackageInstances:
gutenberg/packages/block-library/src/embed/embed-preview.js
Line 10 in 837fda7
gutenberg/packages/editor/src/editor-styles/transforms/url-rewrite.js
Line 4 in 837fda7
(Questionable: Instances within
@wordpress/e2e-testsand@wordpress/e2e-test-utils? These may be compiled with Webpack, despite not being intended for use in a browser)With this, it should be considered to disable automatic polyfills from Webpack (reference).