Open guettli opened 3 years ago
i've achieve such a result by using depp or fetch-inject and a bit of htmx events to dynamically load component stuff from an injected page
Could you expand on that a bit @Tindome ? Would be nice to have your approach documented here at least.
is another way to ask this: Load script tags when included in htmx response
What happens to the library in the browser after the fragment got replaced? We are thinking of building a large composable frontend where potentially lots of small JS libraries might be loaded over time. Will the browser unload them once they are no longer used? Is that even possible?
I want to keep the amount of additional JS small for the initial page load.
Later I might need additional libraries. For example confetti-canvas (see below Stackoverflow question).
It would be very cool if JavaScript libraries could get loaded lazy via hx-get or hx-post.
Steps:
Related StackOverflow issue: https://stackoverflow.com/a/67109472/633961