-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 publish test for avoiding function constructors in non-gl(2d|3d) partial bundles #5383
Add publish test for avoiding function constructors in non-gl(2d|3d) partial bundles #5383
Conversation
package.json
Outdated
@@ -31,6 +31,7 @@ | |||
"watch": "node tasks/watch.js", | |||
"lint": "eslint --version && eslint .", | |||
"lint-fix": "eslint . --fix || true", | |||
"no-new-func": "eslint --no-ignore --no-eslintrc --rule '{no-new-func: error}' dist/plotly-finance.js dist/plotly-basic.js dist/plotly-cartesian.js dist/plotly-geo.js dist/plotly-mapbox.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.
Nice simple command 🌟 I wonder though, is it possible to express this as a list of bundles to exclude - ie "test everything in dist/*js except *.min.js and plotly.js and plotly-gl3d.js and ..." that way over time we simply remove exclusions from the list, and any new bundle we create is automatically included?
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.
Done in c611031.
package.json
Outdated
@@ -31,6 +31,7 @@ | |||
"watch": "node tasks/watch.js", | |||
"lint": "eslint --version && eslint .", | |||
"lint-fix": "eslint . --fix || true", | |||
"no-new-func": "eslint --debug --no-ignore --no-eslintrc --rule '{no-new-func: error}' $(ls dist/plotly*.js | grep -v plotly-locale* | grep -v plotly-gl* | grep -v plotly-with-meta.* | grep -v plotly.js | grep -v plotly.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.
Nice! Probably don't need debug long-term, right? And I feel like we might as well include the locales in this test, for completeness... we know they're safe but wouldn't hurt to prove it.
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.
Looks great - just a nonblocking comment to consider. 💃
let's exclude MathJax then, it's basically "not our problem" |
Thanks to #5358 and #5359 pull requests, most partial bundles namely
basic
,cartesian
,finance
,geo
andmapbox
no longer have function constructors.This PR adds tests in
publish
container to lock this for future bundles.cc: #897
@plotly/plotly_js