-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Updating dashR component generation #1798
Conversation
@@ -5,7 +5,6 @@ | |||
"requires": true, | |||
"packages": { | |||
"": { | |||
"name": "dash-core-components", |
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 is probably due to a minor NPM version difference between your env and whoever last updated this file (likely me)... not a big deal, but let's try not to commit changes like this.
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 we want to keep the package name? For reference, my npm version is 7.15.1
(and node is 16.3.0
).
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 on 7.21.0, 16.8.0 - so yeah, I think this is a new addition to the package-lock format that we should keep.
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.
After upgrading to npm 8.0.0
the name key is now set. Fixed in 01c5803.
@@ -23,7 +23,7 @@ | |||
"elements": [ | |||
"form" | |||
], | |||
"description": "The URI of a program that processes the information submitted via the form." | |||
"description": "The URI of a program that processes the information submitted via the form." |
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.
Weird that we get all this extra whitespace... there was a little bit of it before - like https://github.com/plotly/dash/pull/1798/files#diff-636f7fc815f56fa24377d9d5d7df894abf0ba39621713316f3af387bb5d70c13L310 - but we should really get rid of this, as it DOES make it into the final built components. For example here's height
in Img.py
right now:
- height (string | number; optional):
Specifies the height of elements listed here. For all other
elements, use the CSS height property. Note: In some
instances, such as <div>, this is a legacy attribute, in which
case the CSS height property should be used instead.
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 like here:
dash/components/dash-html-components/scripts/extract-attributes.js
Lines 71 to 75 in b32ac95
const description = $children.eq(2).text() | |
.replace(/\n/g, '') | |
// Fix irregular whitespace characters | |
.replace(' ', ' ') | |
.trim(); |
IDK what replace(' ', ' ')
is supposed to accomplish, but I suspect just turning it into .replace(/\s+/g, ' ')
would do the trick
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.
That fixed it! 01c5803
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.
💃 Excellent!
This PR adds a minor change to the
dashR
component generation by adding anexport
tag so component functions are automatically added to theNAMESPACE
withdevtools::document()
.