Closed floscher closed 2 years ago
I agree we shouldn't be using a CDN here, we should put it in src/resources and load it using the StaticFilesPlugin
, similar to how the fomanticUIPlugin does it, although it shouldn't be a plugin because it's required by default.
I'm not sure when I'll get to this but if you'd like to take a stab at making the change I'd be happy to provide pointers and accept a pull request. If you need this urgently and don't think you can tackle it yourself let me know.
This is deployed in 1.0.1
.
@sanity Thank you very much for fixing this so quickly! :rocket:
When I played around a bit with kweb, I noticed that the page I built makes requests to the 3rd party service JsDelivr.
I would like it if the app relied on as few external services that were hardcoded into it, like Jsdelivr.net in these places: https://github.com/kwebio/kweb-core/blob/14a72c8e378c8285a8480e547005ccd15e1aa101/src/main/kotlin/kweb/html/HtmlDocumentSupplier.kt#L42 https://github.com/kwebio/kweb-core/blob/14a72c8e378c8285a8480e547005ccd15e1aa101/src/main/kotlin/kweb/html/HtmlDocumentSupplier.kt#L56
Since these links always download the latest available version, this could also over time lead to issues when a new toastify version comes out. Then apps built with kweb would automatically switch to the new version with which they might not have been tested with.
So I think there should be an option to at least override where these files are loaded from. Or maybe toastify could be packaged at build time with my app and served through my own backend.
This might not be the optimal solution for everyone, some probably prefer to use a CDN for such files, but I often prefer to self-host these things to be on the safe side regarding privacy and availability of the service, even if it impacts performance a bit.
Thanks for the great project, love the idea. I'll definitely play around with it some more, looks really promising so far!