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
fix(widgets): export @deck.gl/widgets/stylesheet.css #8863
Conversation
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.
Thanks!
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.
No docs? How are users supposed to find out?
Which docs are you referring to? Importing the stylesheet is documented in the widgets modules. |
OK if this is just a bug fix and not a new export path, then it could help if PR title would be prefixed with something like "fix(widgets): ..." For another PR: Reviewing the docs I found this mentioned in the module overview page but not the |
Good call. Updated the title, and I'll update the commit message as well. The core and widget modules are designed to isolated, so I'm hesitant to link to it from core. This CSS file should only be necessary when you're using the widgets shipped in the official widget modules, and Do you think some clarification is necessary? |
Nah. I was really just trying to show my support for and interest in the widget effort by adding a review. All sounds good. |
}, | ||
"./stylesheet.css": { | ||
"import": "./dist/stylesheet.css", | ||
"style": "./dist/stylesheet.css" |
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 can't find any documentation about this field. I do see some libraries set the top-level style
field, though, like bootstrap. Maybe that is what we need?
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.
Perhaps default
could replace both import
and style
here? I believe this change is currently fine for ESM users but may break for CJS users. The subset of bundler configs that are still using CJS but are new enough to import stylesheets might be small.
I'm having trouble finding information on package.json#style
but I think the idea is that it resolves things like imports within PostCSS modules:
@import "some-stylesheet-package";
.foo {
background: orange;
}
A bundler may also inline your dependencies' style
fields by default, but may not:
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.
@atmorling could you point us to where found this solution? Maybe this style tag should be removed if it doesn't seem to do anything.
I can go either way on the top-level style
since it doesn't seem standardized, though I'm leaning towards doing what can be tested (add a post-css test app?)
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 found it in a webpack guide on package.json documentation, but you're right, it doesn't appear in Node's documentation at all. It should probably be removed.
* remove container from zoom-widget docs * add export for @deck.gl/widgets stylesheet
Closes #8862
Change List
package.json
Disclaimer
I've tested the
import
case with thetest/apps/widget
example, I have not tested thestyle
case, mainly because I'm not 100% sure on the best way to do so, happy to take guidance on testing that without having to publish.