ProjectEvergreen / wcc

Experimental native Web Components compiler.
https://merry-caramel-524e61.netlify.app
90 stars 7 forks source link

bug/issue 128 fix shadow root rendering for JSX #129

Closed thescientist13 closed 10 months ago

thescientist13 commented 10 months ago

Related Issue

resolves #128

Summary of Changes

  1. Wrap JSX that renders into a shadow DOM with a <template> tag
  2. Fix issues with inferredObservability interop
  3. Added a test case (there was never one to begin with 😱 )
  4. All sandbox demos are working as expected now 🎉
  5. Updated documentation, examples, and caveats for JSX support

See https://github.com/thescientist13/greenwood-htmx/pull/10 for a working example

TODO

  1. [x] JSX + Shadow DOM testing - see https://github.com/ProjectEvergreen/wcc/issues/130
    • so yeah, the current implementation is not going to work, if use shadowRoot.innerHTML we're still going to keep getting runtime warnings Screenshot 2024-01-03 at 6 53 46 PM
  2. [x] Greenwood regression testing
  3. [x] more test cases, like for inferredObservability
  4. [x] documentation
  5. [x] reuse HTMLTemplateElement (e.g. DOM shim) instead of manually wrapping - N / A
  6. [x] refactor DSD render function implementation to avoid innerHTML usage (nice to have, otherwise could be a good first issue) - made its own issue, but of lower priority if we can get #108 working (since renders would only happen once) - https://github.com/ProjectEvergreen/wcc/issues/138