Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.39.0 Updates #353

Merged
merged 35 commits into from
Sep 23, 2024
Merged

0.39.0 Updates #353

merged 35 commits into from
Sep 23, 2024

Conversation

ryansolid
Copy link
Owner

This release updates and adds some new features:

  • Improved Custom Element/Shadow DOM traversal - @olivercoad
  • Better heuristic to determine when to importNode - @titoBouzout
  • handleEvent syntax to allow custom event properties when not delegated - @titoBouzout
  • support for bool: attribute namespace - @titoBouzout
  • add "is" as detection for custom element - @titoBouzout
  • fix missing exports in different envs - @trusktr
  • better hydration mismatch errors - @ryansolid
  • improved HTML validation of JSX partials - @titoBouzout

titoBouzout and others added 30 commits September 6, 2024 15:08
* Add tests for event delegation and shadow dom

* Retarget when walking up shadow DOM

* Use composedPath where possible for bubbling events

* Explicitly reset to original target

---------

Co-authored-by: Oliver Coad <[email protected]>
…the object for `options` (#341)

* allow `addEventListener` to use `handleEvent` syntax while using the object form for options

* add type to client.d.ts

* add type to lit-dom-expressions/src/index.ts

* add to `assignProp`

* add to `removeEventListener` on client.js

* Update types

* Update types

* formatting

* add `EventHandlerWithOptions` type

* use  dom-expressions `addEventListener` instead of the browser one for custom events. Move `oncapture` to its own conditional

* add test for expected compile output

* add test using jsdom to assert a handler with `once` only runs once
* preliminary support for ``bool:`

* make code smaller

* value of attribute should be empty when adding it to the dom

* inline bool: attribute into the template when possible

* fix prop name

* undo space test
* Add tests for event delegation and shadow dom

* Retarget when walking up shadow DOM

* Use composedPath where possible for bubbling events

* Explicitly reset to original target

---------

Co-authored-by: Oliver Coad <[email protected]>
…the object for `options` (#341)

* allow `addEventListener` to use `handleEvent` syntax while using the object form for options

* add type to client.d.ts

* add type to lit-dom-expressions/src/index.ts

* add to `assignProp`

* add to `removeEventListener` on client.js

* Update types

* Update types

* formatting

* add `EventHandlerWithOptions` type

* use  dom-expressions `addEventListener` instead of the browser one for custom events. Move `oncapture` to its own conditional

* add test for expected compile output

* add test using jsdom to assert a handler with `once` only runs once
* preliminary support for ``bool:`

* make code smaller

* value of attribute should be empty when adding it to the dom

* inline bool: attribute into the template when possible

* fix prop name

* undo space test
…ow an error (#345)

* export constants from dom-expressions server.js

* export functions from dom-expressions server.js to match client.js exports, and make client-only functions throw on the serverside

* add missing imports, add missing types

---------

Co-authored-by: Ryan Carniato <[email protected]>
Co-authored-by: Ryan Carniato <[email protected]>
This reverts commit 553935b.
titoBouzout and others added 5 commits September 23, 2024 11:48
* validates whole partial

* display a warning instead of an error

* greatly improves the error message

* improve readability

* add `templateWithClosingTags` accumulated string for faithful validation

* include dom-expressions comments in the validation

* refactor validate function to make it more simple and show diffs next to error message

* remove old comment

* handle "content" outside tags, handle edge case: tr/td

* fix typos

* doesnt need capturing

* handle text nodes moves

* use `#text` instead of an underscore, it's less cryptic

* improve comments

---------

Co-authored-by: Ryan Carniato <[email protected]>
@ryansolid ryansolid merged commit 2c8a9b1 into main Sep 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants