GithubHelp home page GithubHelp logo

Comments (4)

pavlospt avatar pavlospt commented on April 27, 2024 1

I have started working on this and my progress so far is:

  • I have added the ability to add a ResType on a PropDefault annotation.
  • I extract it successfully and add it on the PropDefaultModel
  • Parsing it correctly and initializing the Prop field with a proper initializer (only using the resolveDimenSizeRes() for now)

My thoughts on the above:

  • In order to use the resource resolve method, I tweaked the Component class to extend ResourceResolver and code generation works properly now. Although what this does, is crash on Runtime because it does not have a valid ComponentContext to call super.init(c, c.getResourceCache()).

I do not know if I am on the right path yet, but it seems to me that in order to support this we need to either extend ResourceResolver from Component and provide it with a valid ComponentContext or just initialize the PropDefault marked variable on the Builder where we have a valid ComponentContext.

Let me know what you think.

/cc: @emilsjolander @passy

P.S.: Sorry for pinging here as well, might seem like spamming, but I want to save the time for anyone who would like to start working on this one and we end up having duplicate work.

from litho.

emilsjolander avatar emilsjolander commented on April 27, 2024

Could you publish your current progress as a pull request? This way we could make better suggestions based on the code. From the info you provided I think both alternatives would work. I see no reason not to pass the context down to the component.

from litho.

pavlospt avatar pavlospt commented on April 27, 2024

@emilsjolander Ok will try to prepare a PR for them later in the day or tomorrow :)

Edit: Only thought on passing the ComponentContext down to Component, is that it would introduce a breaking change If I am not mistaken.

from litho.

pavlospt avatar pavlospt commented on April 27, 2024

Can be closed!

from litho.

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.