-
-
Notifications
You must be signed in to change notification settings - Fork 43
pass command line options to plotly-dash-preview #191
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
Conversation
package-lock.json
Outdated
@@ -57,7 +57,7 @@ | |||
"@sinonjs/samsam": { | |||
"version": "3.0.2", | |||
"resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.0.2.tgz", | |||
"integrity": "sha512-m08g4CS3J6lwRQk1pj1EO+KEVWbrbXsmi9Pw0ySmrIbcVxVaedoFgLvFsV8wHLwh01EpROVz3KvVcD1Jmks9FQ==", | |||
"integrity": "sha1-ME+zO9VYWgst+KTIAfy0f6hNjkM=", |
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 stuff here shouldn't happen.
Which npm version are you using?
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'm using 6.4.1
... Sorry about that. Using 6.5.0
gives me sha512
hashes as expected.
What do you think of the idea of adding "npm": "^6.5.0"
in devDependencies
?
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 didn't add npm
in devDependencies
but used a newer npm version to update package-lock.json
in commit 78f3dd8.
Putting npm
in devDependencies
would make sense to me. That way we would all use the exact same version by running ./node_modules/.bin/npm
. We can discuss that later :)
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.
Hmm. You're suggesting listing npm
as a dependency of things to install with npm
? That's sounds strange. I've never seen that before. Maybe it's a thing though.
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.
You're suggesting listing
npm
as a dependency of things to install withnpm
?
Said that way it sounds kinda stupid indeed 😆. We could instead update the CONTRIBUTING.md
to state what version of npm
is required.
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.
We use the engines
property in package.json
for this in Dash:
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.
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.
Actually, it doesn't really behave the way I was hoping for.
const numberOfComponents = 6 | ||
const axios = require('axios') | ||
const fs = require('fs') | ||
const pathToPlotlyJS = '/tmp/plotly-latest.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.
Let's put that in ./build
aka paths.build
and use path.join
so that your path is compatible on Windows:
const = path.join(paths.build, 'plotly-latest.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.
Brillant! Done in 3e10734
|
||
const { paths } = require('../common') | ||
|
||
const PORT = 9109 + 2 |
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.
9111
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 3e10734!
values.forEach(result => { | ||
var urls = result.value | ||
urls.forEach(url => { | ||
t.notOk(url.match('http'), `A script tag refers to an HTTP resource ${url}`) |
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.
Shouldn't we test https
also?
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 this works since https
will match http
!
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.
Ah I see. Could you change the assert msg to
`A script tag refers to an HTTP(S) resource ${url}`
then to avoid any potential confusion.
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 d29367d
💃 |
Prior to this PR, the HTML file used by
plotly-dash-preview
would ALWAYS link to plotly.js on the CDN even when the command-line arguments--plotlyjs
is used.