Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

htmx-ext-htmx-1-compat

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmx-ext-htmx-1-compat

The `htmx-1-compat` extension allows you to almost seamlessly upgrade from htmx 1.x to htmx 2.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

The htmx-1-compat extension allows you to almost seamlessly upgrade from htmx 1.x to htmx 2.

Install

<script src="https://unpkg.com/htmx-ext-htmx-1-compat@2.0.0/htmx-1-compat.js"></script>

What it covers

Htmx 2 introduced a few breaking changes.

To make upgrading from htmx 1.x to htmx 2 easier, we're providing this extension that reverts most of those, so you're able to benefit from the other changes without breaking your application.

Obsolete attributes

  • htmx 2 removed the deprecated hx-ws and hx-sse attributes, that this extension restores.
  • htmx 2 removed the deprecated hx-on attribute in favor of the wildcard hx-on* attribute, that this extension restores.

Default Changes

  • reverts htmx.config.scrollBehavior to 'smooth'.
  • makes DELETE requests use a form-encoded body rather than URL parameters (htmx 2 uses URL parameters for DELETE as default as per the spec).
  • allows cross-domain requests by default (htmx 2 now forbids it by default).

What it does not cover

  • IE11 support was dropped in htmx 2, and this extension cannot revert that. If you need IE11 support, please stay with htmx 1 that will continue being supported.
  • htmx 2 introduced the breaking change that is the swap method to the extensions API. If you were only using core extensions, then you shouldn't need any additional work. If you were using custom or community extensions, make sure that they were updated to work with htmx 2's API.

FAQs

Package last updated on 14 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc