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
Create a AbstractTheme class for controlling theme #3196
Comments
The dependency-filter/rewrite approach kinda scares me, but I understand it must have been discussed thoroughly if that's the final choice. Just out of curiosity, why not having the |
Some aspects from our discussions:
|
Thank you @Legioth for exposing these aspects, they seem totally reasonable considering the specificity of Vaadin's elements styling. My main concerns at first were related to bundling and JRebel-like hot deployment tools, but then it's up to them to handle the process correctly. BTW with my (totally hasty) idea, I didn't mean to add theming support to
Then the user may also be able to choose/change the theme while using the app. |
Bundling needs some special attention regardless of whether the definition of what to import is determined based on a generic rewrite rule or a hardcoded mapping. The plan is to integrate this into our Maven plugin (and preferably do that in a way that is also reusable for other build tool integrations). I now realized that one implication of this is that the rewriting logic should probably not be directly based on I don't think tools like JRebel would cause any problems here since the rewrite would still be applied again every time a Changing the theme of an already loaded app is not supported on the Web Component level. The page always has to be reloaded in the browser to avoid conflicts with a previously loaded theme. |
reworded to 'import filtering with simple pattern matching' |
I don't think it even needs to be "simple". It can still be arbitrary string handling logic. When bundling, the callback would just be run once for each available input file. |
The bundling part, e.g. using the pattern to figure out what sources need to be in the bundles, is excluded from this issue. |
AbstractTheme
should contain abstract methods thatwill be used to populate any extra things wanted to the
initial Bootstrap page (like with
PageConfigurator
,@Inline
orBootstrapListener
)AbstractTheme
should also contain import filtering with simplepattern matching to rewrite html imports as needed. e.g. "/src/" -> "/theme/valo/"
If the file exists (either directly through ServletContext or in a WebJar), then the rewritten name is used.
(Note! Might require caching logic to reduce I/O overhead, Might cause extra complexity for checking whether a file exists if it has been moved into a bundle)
The text was updated successfully, but these errors were encountered: