Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A bunch of
morphdom
alternatives emerged over the past few months. Some of them are very similar to morphdom but each of them has their own nuance.For now morphdom will stay the default, but there should be an option to replace morphdom with another library fairly easily, so you can chose the best suiting morphing library for your project.
In order to be fully compatible with all approaches
turbo-morph
is going to support the following morphing libraries:morphdom
(default)@alpinejs/morph
nanomorph
micromorph
idiomorph
diffhtml
diff-dom
Current import/initialize
Currently the import and initialize of the library looks like:
With this Pull Request
If you want to be explicit about what you use (if for some reason
turbo-morph
is going to change the default in the future) you can rewrite the import-statement like so and everything will continue to work as it did before:But with that you can also easily swap out morphdom with the Alpine plugin if you like:
Using multiple plugins at the same time:
There might be reasons why you would want to use multiple plugins at the same time. For example if one library is better suited in one place whereas another library is better suited in another place in your application.