Giter VIP home page Giter VIP logo

Comments (5)

skylerjokiel avatar skylerjokiel commented on July 19, 2024

Yea. This is predicated on the fact that if you implement IComponentForge someone needs to forge you before they attach you. I had a pr https://github.com/microsoft/Prague/pull/2993 to push the forging logic into the runtime but it got some push back and I haven't got back around to looking at it.

Overall there's a question of:

What happens if you are creating a component that requires some props as part of creation?

Options that I've considered:

  1. instantiateComponent takes a props somehow (passed in via IComponentContext or an additional property). This is similar to how we pass the isExisting flag currently. our createComponent(id, pkg, props?) and the props would be passed into the instantiateComponent call. The developer would then need to know to look for those props and pass them into their constructor or initialize step appropriately.

  2. instead of just having an instantiateComponent call we could have two. instantiateComponent and createComponent that the developer has to implement and we call them depending on if it's the first time or not. I don't like this because I feel like it's a lot of extra work on the developer.

  3. We have a pattern where the caller is required to call forge(props) after creation. This is what we went with but since there is not compile time break it's easy to mess up. If we want to continue with this path we should make it part of the runtime.

I like 1 & 3 and have been leaning back and forth.

from fluidframework.

DLehenbauer avatar DLehenbauer commented on July 19, 2024

I'd recommend option 1. You'll then no longer need the IComponentForge interface.

from fluidframework.

skylerjokiel avatar skylerjokiel commented on July 19, 2024

@DLehenbauer , yea I agree.

from fluidframework.

tylerbutler avatar tylerbutler commented on July 19, 2024

@skylerjokiel is this still relevant since forge was removed?

from fluidframework.

skylerjokiel avatar skylerjokiel commented on July 19, 2024

This issue is resolved now.

from fluidframework.

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.