Code Monkey home page Code Monkey logo

Comments (6)

dakur avatar dakur commented on June 2, 2024

Hm, I've tried it also in fresh nette project and the decorator was called as expected. So it will be probably in some other place, sorry for the issue.

from di.

mabar avatar mabar commented on June 2, 2024

It may be related to presenters being automatically registered as services (optionally). I guess your presenter is created in runtime and so does not exist in generated DIC and DecoratorExtension can't apply its setup.

Simplest way to fix it is register presenter as a service manually. Otherwise you will have to debug, why your presenter is not found by ApplicationExtension

from di.

dakur avatar dakur commented on June 2, 2024

Thanks for your answer! Yes, you are right, if I register e.g. HomepagePresenter, the decorator is finally called. But I don't understand why it worked before the update. 🤷‍♂️

Also, not sure what to do when I need to decorate abstract presenter. Do I have to list all of the child presenters? Maybe some GTMConfig service holding the boolean and passed to abstract presenter would be better then I guess..

from di.

mabar avatar mabar commented on June 2, 2024

Did you also update nette/application? Or do you have application: options like scanComposer, scanFilter, scanDir set?

Do I have to list all of the child presenters?

Yes, decorator works with service definitions, each presenter must be available as a service.

from di.

dakur avatar dakur commented on June 2, 2024

Did you also update nette/application?

No

Or do you have application: options like scanComposer, scanFilter, scanDir set?

Yes, scanDirs: false

from di.

dakur avatar dakur commented on June 2, 2024

There was probably some perf improvement in nette/di which caused that decorating unscanned presenters stopped working. It makes sense actually when I chose not to scan for presenters. 🙂 Did forget about that setting.

from di.

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.