-
Notifications
You must be signed in to change notification settings - Fork 975
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
support package and local css includes #1283
Conversation
I think the JS ones should be |
Codecov Report
@@ Coverage Diff @@
## main #1283 +/- ##
==========================================
- Coverage 89.30% 89.05% -0.25%
==========================================
Files 19 19
Lines 1234 1243 +9
Branches 243 245 +2
==========================================
+ Hits 1102 1107 +5
- Misses 99 101 +2
- Partials 33 35 +2
Continue to review full report at Codecov.
|
Oh sorry, perhaps I miscommunicated... This PR (the current implementation) does not break API - both JS and CSS files are specified using Are you suggesting we go for the alternative approach, but without breaking the API? For example: class MyCustomModule(VisualizationElement):
package_includes = ["PackageJavaScript.js"] # same as before
package_css_includes = ["PackageStylesheet.css"] # new attribute
local_includes = ["MyCustomJavaScript.js"] # same as before
local_css_includes = ["MyCustomStylesheet.css"] # new attribute |
class MyCustomModule(VisualizationElement):
package_includes = ["PackageJavaScript.js"] # same as before
package_css_includes = ["PackageStylesheet.css"] # new attribute
local_includes = ["MyCustomJavaScript.js"] # same as before
local_css_includes = ["MyCustomStylesheet.css"] # new attribute Yes, this one. |
At the same time, implementing #1210 will necessarily introduce breaking change (this change is necessary to simplify the tutorial for Windows and macOS). Maybe we should go to 1.0.0 instead of 0.10.0 after all (@tpike3 @jackiekazil)? Regardless, the rename to |
7e0784c
to
6688204
Compare
LGTM |
This PR tries to address #1267. The user interface remains the same, e.g.:
Then these included files get saved into
package_js_includes
,package_css_includes
,local_js_includes
andlocal_css_includes
attributes. Whether it's a stylesheet or not depends on whether the filename ends with.css
.An alternative approach that is not implemented with this PR would be to let users decide by themselves on demand. For example like this:
In this way we don't need to check whether files are stylesheets or scripts. But this breaks API and introduces more complexity in developing customized elements.
Please feel free to suggest other possible approaches.