Open taromero opened 9 years ago
Yeah, I've realised this is kind of a "bug by design" - being too zealous on caching ;)
I've got similar problem on one of my projects and will tackle that very soon :)
Would love to see this also, i am loading ionic css files for some mobile specific pages, but it completely messes up some other pages once it's loaded.
@taromero could you elaborate on how you are handling this?
Thanks
Gareth
Hey guys,
I forgot to answer it here (and in docs), but since v1.2.1 CSS libraries are removed if not needed on a certain route and only those defined for a particular route are loaded.
Please, try with the latest version (v1.2.4) and let me know if it works better now.
If not, please give me some code to test it out.
I tested it and the CSS file is removed when go to other route (v1.2.4). It Work as expected.
Btw, do we need to remove the loaded js file when change route as well?
For example, i have a word processor route that load firepad.js. When i change to dashboard route isn't it logical to remove any variable and function related to firepad so that it will make resources lighter when accessing dashboard route.
Since I plan to make multiple heavy processing module in different routes (e.g. diagram tool, writing tool, review module, etc), I think this clean up process is necessary. In traditional webapp, the cleanup process solved using page refresh.
I know i can remove variable created in the template by utilizing Template onDestroy but how about variable and function in firepad.js? Maybe something like javascript file unload when go to other route.
Or i just leave it to javascript automatic garbage collection to clean up resources in firepad.js?
Thank you for your insight.
Currently I'm trying to use this library to manage a case where I need
Bootstrap
css on a set of routes (admin routes, as of meteor-admin) andMaterialize
css on another set of routes. To acomplish this, I load the materialize css when on certain routes.The issue comes when I go back to the Bootstrap routes, as then I have both css loaded.
Currently I'm dealing with the issue by manually removing a certain
link
tag on the default router onBeforeAction callback, but it would be nice to have a declarative option to remove the set of assets that are loaded, when the route changes.