Giter Club home page Giter Club logo

Comments (5)

saivishwak avatar saivishwak commented on July 20, 2024

https://github.com/ryansolid/dom-expressions/blob/main/packages/babel-plugin-jsx-dom-expressions/src/shared/utils.js#L79

Has the check for first letter to be capital

from dom-expressions.

ryansolid avatar ryansolid commented on July 20, 2024

I'm confused by the ask. Custom elements(webcomponents) are native elements so they should already work today by using all lowercase. Web Components aren't JSX components so they should fail that check. JSX components are just functions whereas web components are registered as part of the native platform.

Other tooling including TypeScript relies on this capitalization heuristic in terms of naming what is a component or not.

from dom-expressions.

saivishwak avatar saivishwak commented on July 20, 2024

I was trying to add web components directly in solid code and now if the web components props are tied to any signal it still does not auto update the prop internally as the compiled output does not handle this scenario.

After some research found out the way solid element is handling this, via creating signals for props and passing in an object with getter and setter to access the signal.

const [count, setCount] = createSignal(0);
return (
<div>
   <web-component title={count()}></web-component>
</div>
)

In this example when count changes the web-component does not reflect the changes. Not sure if this is what SolidJS should handle as it might be out of context from its perspective.

from dom-expressions.

ryansolid avatar ryansolid commented on July 20, 2024

If you have a web component that updates in response to props or attribute changes the internal mechanism doesn't have to be Signals. Solid will make sure that on signal value outside we update those properties, but your webcomponent should be able to handle those changes itself. If it doesn't watch properties you can prefix with attr: which will force attributes. See if that works for you.

from dom-expressions.

saivishwak avatar saivishwak commented on July 20, 2024

Yes, Internal Mechanism of prop updates are handled at web components. The outside world props changes were reflected using signals.

Thanks for the clarification.

from dom-expressions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.