-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adding htmx extensions ? #4
Comments
i think htmx's plugins are not supported so your best bet at the moment is to add the script tag manually to your pages / layouts. i will have to check if it's possible to include extensions in the plugin |
found this issue on the htmx repo. i will wait until something happen there but it seems to be a common issue with Vite / any bundler and using HTMX |
all the integration does is... add the htmx script tag before initialisation So.. what if we maintain an object with extension names & their urls like this type ext = 'client-side-templates' | 'json-env' | 'ws' // ... all extensions available by htmx
const url = `https://unpkg.com/htmx.org/dist/ext/${ext}` and then import it in the script tag the same way u add a script tag for htmx code.. in this integration |
I think this is going outside of the scope of this extension as this is using remote scripts. If anybody needs HTMX extension, feel free to opt-out of |
But htmx 2.0 leans heavily on extensions such as ws, sse and a ton of there things. So with supporting extensions this astro extension becomes very limited if not useless. |
What else u think is happening here ? the script is actually remotely fetched from npm registry when we use unpkg.com. In case u need While adding extensions as dependencies might not be the ideal approach to go with... since it might bloat the integration with htmx extensions the developer might not need... But having a way to integrate these with astro-htmx would be really helpful |
@RayyanNafees there is a clear distinction between installing and bundling your own dependencies and serving from a CDN. I will dig to find a proper solution but I don't think mixing bundled deps and CDN assets is the right call. |
How to add htmx extensions using this like
json-enc
The text was updated successfully, but these errors were encountered: