Comments (3)
I see. So 2 completely separate instances on the same page. Yeah I never gave this scenario any consideration. Obviously sharing the runtime where possible is beneficial, but I can understand where it might not make sense to.
The easiest would be a global. Otherwise we'd need to try shifting the delegated entry which is trickier with Portals and removes the benefit of delegation with web components, or turn the per template compilation and runtime execution like spreads to make the event key writing to be a lookup. Those solutions are technically better as if the nature of these are dynamic and we wanted to do cleanup on global no particular bundle would know if it could.
Let me see what we can do here.
from dom-expressions.
Thanks, it would be very useful for apps which glue multiple self-contained widgets together. Instinctively, I think it would be cool to have a single shared event handler. So, in case of 10 widgets on a single page we'd benefit from event delegation and also there wouldn't be 11 event handlers 😃
from dom-expressions.
Yeah... cleanup of event delegation is manual. So this seems reasonably at least for now. If I ever made cleanup non-manual I'd need a different solution. I'll go with global for now. Revisit later as needed.
from dom-expressions.
Related Issues (20)
- [html] top level <style> causes TypeError: Cannot read properties of undefined (reading 'firstChild')
- [html] empty html template causes TypeError: Cannot read properties of undefined (reading 'name')
- `o[1] is not a function`
- There is no definition of `media` property in interface `MetaHTMLAttributes`
- Bug in generic types for universal render target? HOT 5
- Type definitions of `classList` are wrong HOT 8
- Treat `inert` as a boolean attribute
- Support combining tag classes and the class property in hyper dom expressions HOT 1
- Don't consider namespace imports to be dynamic expression HOT 3
- Emit var instead of const for generated element references HOT 7
- Add ability not to treat every tag with `-` in name as web component HOT 4
- `this` inside arrow function is incorrect after Solid transform HOT 3
- `<this.Foo />` doesn't work HOT 2
- Supporting iterable collections HOT 4
- Question: Possible to use third-party component libraries with Tagged Template Literals? HOT 6
- Template generation template literal escape problem
- bug: Compilation from JSX style attribute to ternary results in functions getting called twice HOT 1
- JSX attribute types HOT 2
- Option for preserving whitespace within JSXChildren HOT 1
- Fragment loses reactivity when using HDE HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dom-expressions.