Git Product home page Git Product logo

Comments (4)

michaelobriena avatar michaelobriena commented on September 28, 2024

I think there is something we can do with the initial mount but updating the inner scene whenever the DOM element that it is mounted into changes size is something that is a bit trickier. Since the DOM does not give resize events for non body elements, we would have to bake this pretty deep into the implementation. I think for now, the fact that is is possible is good enough while we talk about how cleanly we could implement this.

One question I have is what usecase are you using nested scenes for? Where do you see the benefits besides just adding a new subtree to the scene?

from engine.

pilwon avatar pilwon commented on September 28, 2024

@michaelobriena The linked example is the use case. I'd like to render a React component to a DOM element managed by famous but this React component can contain one or more famous scenes.

It allows me to reuse existing React components. More importantly, it provides developers an option for progressive enhancement with famous.

from engine.

FarhadG avatar FarhadG commented on September 28, 2024

What's the status on this issue and PR?

It appears a fix was made for the events, but curious whether a solution was also put forth regarding this issue.

@michaelobriena @DnMllr

from engine.

michaelobriena avatar michaelobriena commented on September 28, 2024

@pilwon @FarhadG, @alexanderGugel is working on a solution for the ability to get the DOM element associated with a Famous Node. This will be done via event hooks in the DOM renderer, not as a method on the component itself.

We cannot have nested compositors update their size for free since an html element resizing does not trigger an event and it is not something we want application side since it is a use case we do not want to support for a variety of reasons (Breaks in worker code, breaks in server side code, DOMElements are pooled so it isn't guaranteed to be correct forever, multiple scenes breaks the compositing abstraction). The event hooks I mentioned will give users the knowledge needed so they can trigger actions to occur when appropriate for their particular integration.

I would like to close this for now because any special casing of nested scenes is not something we are looking to handle at the rendering engine level.

from engine.

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.