Overview
I think Idiomorph could benefit from a plugin system.
The idea here to is make it easy to encapsulate useful ideas and integrations in individual files or packages, e.g. "idiomorph/ignore-value", "idiomorph/htmx", "idiomorph/ignore-active-value", "idiomorph/turbo", etc. Multiple plugins should be able to be easily composed.
Benefits
- Potentially slimming down core by extracting less-used options into plugins. Maybe
ignoreActive or ignoreActiveValue might be good candidates for this... we'd need to determine their frequency of usage.
- Allowing transparent composition of different callback-related concerns. Right now, all lifecycle callbacks are singletons. So if one wants to register multiple
beforeNodeMorphed callbacks, for example, they'd have to manually compose the individual functions themselves.
- Enabling experimentation and third-party integration outside of core. This could enable third-party npm packages to be published that provide an Idiomorph integration or modification, without requiring us to merge anything into core.
Challenges
- Can this system support
require, import, and <script src>?
- What if we don't control the Idiomorph call itself? For example, Idiomorph is a hidden implementation detail of Turbo. Could a user of Turbo add a plugin to Idiomorph, even though it's buried in the guts of Turbo?
Thoughts?
Overview
I think Idiomorph could benefit from a plugin system.
The idea here to is make it easy to encapsulate useful ideas and integrations in individual files or packages, e.g. "idiomorph/ignore-value", "idiomorph/htmx", "idiomorph/ignore-active-value", "idiomorph/turbo", etc. Multiple plugins should be able to be easily composed.
Benefits
ignoreActiveorignoreActiveValuemight be good candidates for this... we'd need to determine their frequency of usage.beforeNodeMorphedcallbacks, for example, they'd have to manually compose the individual functions themselves.Challenges
require,import, and<script src>?Thoughts?