-
Notifications
You must be signed in to change notification settings - Fork 326
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
Read MapBox API token at runtime #11889
Conversation
🧪 Storybook is successfully deployed!📊 Dashboard:
|
node.href = url | ||
node.rel = 'stylesheet' | ||
} else if (type === 'scripts') { | ||
assert(node instanceof HTMLScriptElement) |
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 should be a console error and a graceful continue
instead of an assert. The visualizations code needs to be treated as user input.
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.
The node
here is created a few lines above depending on the type
variable, and the assert plays the role of a safe type coercion.
const nodeKind = type === 'scripts' ? 'script' : 'link' | ||
const node = document.createElement(nodeKind) | ||
if (type === 'styles') { | ||
assert(node instanceof HTMLLinkElement) |
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.
Same here, don't assert in what's effectively a user input parsing code.
* Read mapbox API token at runtime, fix scaling issue * Load styles the same way as scripts * remove mapbox dependency * Update changelog (cherry picked from commit c2059be)
* Read mapbox API token at runtime, fix scaling issue * Load styles the same way as scripts * remove mapbox dependency * Update changelog
Pull Request Description
Closes #10808
The
ENSO_IDE_MAPBOX_API_TOKEN
environment variable must be provided at runtime if one wants to use geomap visualization. I also bumped the version of mapbox and implemented async CSS loading in the same way we loaded custom JS for visualizations.Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.