Conversation
|
@adamghill Thanks for opening this! I see this PR is mostly scaffolding to introduce morphing algorithms into Unicorn, with initial support for both Idiomorph and Nanomorph. A few thoughts: Selection logic: Right now there are two separate getMorpher() functions. It might be clearer to unify this into a single factory that accepts a strategy argument (e.g., "idiomorph" vs "nanomorph"). Testing: Even at this setup stage, adding basic tests—especially around Nanomorph’s <script> handling—will help prevent regressions. Documentation: A short note explaining why Unicorn is experimenting with multiple morphing libraries would help contributors / users understand the intent. Defaults: Since Unicorn already has a morphing implementation, Idiomorph and Nanomorph should probably be opt‑in alternatives rather than replacements. Making this configurable would be valuable. Potential Additions Add a configuration option in Unicorn settings to choose the morphing strategy (Unicorn default, Idiomorph, or Nanomorph). Provide a benchmarking utility to compare performance and DOM diff accuracy between morphers. Explore hybrid strategies (e.g., Unicorn default for most cases, Nanomorph for script‑heavy components). Consider fallback handling: if one morpher fails, gracefully retry with another. Write a migration guide for contributors explaining how morphing affects Unicorn’s rendering lifecycle. I haven’t pulled this down locally to test yet, so these notes are based on reviewing the code and setup. |
No description provided.