-
Notifications
You must be signed in to change notification settings - Fork 22
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
Reduce node polyfills #3922
Reduce node polyfills #3922
Conversation
@@ -256,14 +256,6 @@ module.exports = (env, options) => | |||
...(isProd(options) || process.env.DEV_REDUX_LOGGER === "false" | |||
? { "redux-logger": false } | |||
: {}), | |||
|
|||
// Enables static analysis and removal of dead code | |||
"webext-detect-page": path.resolve( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't save much at the moment, dropping
), | ||
|
||
// Lighter jQuery version | ||
jquery: "jquery/dist/jquery.slim.min.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to the shared config
REDUX_DEV_TOOLS: !isProd(options), | ||
NPM_PACKAGE_VERSION: process.env.npm_package_version, | ||
ENVIRONMENT: process.env.ENVIRONMENT ?? options.mode, | ||
ENVIRONMENT: options.mode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnvironmentPlugin
already uses process.env
natively. As the comment suggests, these are just fallback values
webpack.sharedConfig.js
Outdated
}, | ||
extensions: [".ts", ".tsx", ".jsx", ".js"], | ||
fallback: { | ||
http: false, | ||
https: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume we don't use external references in our schemas. If we do, I'll have to restore these 2 polyfills in NodePolyfillPlugin
until:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the schema URL references count? I don't think they are being actually requested anywhere.
const SCHEMA_URLS: Record<string, UnknownObject> = { |
We also have "external" references in blocks definitions (some of them like pipeline
don't work though):
$ref: "https://app.pixiebrix.com/schemas/pipeline#", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's exactly it, $ref will be "resolved", in this case by first fetching the external schema (I presume): https://github.com/APIDevTools/json-schema-ref-parser#the-solution
I restored the http/https polyfills for now, hopefully the maintainers will use fetch
in the future.
Codecov Report
@@ Coverage Diff @@
## main #3922 +/- ##
=======================================
Coverage 46.71% 46.71%
=======================================
Files 858 858
Lines 25446 25446
Branches 5313 5313
=======================================
Hits 11887 11887
Misses 12622 12622
Partials 937 937 Continue to review full report at Codecov.
|
webpack.sharedConfig.js
Outdated
}, | ||
extensions: [".ts", ".tsx", ".jsx", ".js"], | ||
fallback: { | ||
http: false, | ||
https: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the schema URL references count? I don't think they are being actually requested anywhere.
const SCHEMA_URLS: Record<string, UnknownObject> = { |
We also have "external" references in blocks definitions (some of them like pipeline
don't work though):
$ref: "https://app.pixiebrix.com/schemas/pipeline#", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoketested, every context and common actions work, merging
This PR just addresses some minor issues I encountered while debugging #3915