Skip to content
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

htmx extension without globals #38

Open
silverwind opened this issue Feb 14, 2024 · 0 comments
Open

htmx extension without globals #38

silverwind opened this issue Feb 14, 2024 · 0 comments

Comments

@silverwind
Copy link

silverwind commented Feb 14, 2024

The htmx init code here relies on a htmx global:

htmx.defineExtension('morph', {

While reliance on globals is probably okay with <script> usage, in a scenario with a bundler it is not necessary and undesired to have any globals. How about allowing something like this?

import htmx from 'htmx.org';
import idiomorph from 'idiomorph/dist/idiomorph-ext-bundler.min.js';
htmx.defineExtension('morph', idiomorph);

Related: bigskysoftware/htmx#1690

@silverwind silverwind changed the title htmx extension init without globals htmx extension without globals Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant