Skip to content
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

Merged
merged 7 commits into from
Oct 14, 2021
Merged

Updating dashR component generation #1798

merged 7 commits into from
Oct 14, 2021

Conversation

HammadTheOne
Copy link
Contributor

This PR adds a minor change to the dashR component generation by adding an export tag so component functions are automatically added to the NAMESPACE with devtools::document().

@@ -5,7 +5,6 @@
"requires": true,
"packages": {
"": {
"name": "dash-core-components",
Copy link
Collaborator

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.

Copy link
Contributor Author

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).

Copy link
Collaborator

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.

Copy link
Contributor Author

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."
Copy link
Collaborator

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like here:

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fixed it! 01c5803

@HammadTheOne HammadTheOne mentioned this pull request Oct 8, 2021
2 tasks
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Excellent!

@alexcjohnson alexcjohnson merged commit 0299406 into dev Oct 14, 2021
@alexcjohnson alexcjohnson deleted the update-r-generation branch October 14, 2021 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants