Git Product home page Git Product logo

Comments (7)

jneem avatar jneem commented on July 23, 2024 1

I'm a bit conflicted here. I'm not sure it's reasonable to assume that compute_max_intrinsic will always be propagated recursively. The way druid allows custom implementation of its traits makes it hard to have firm rules like this. And going back to the original PR that introduced it, I'm pretty sure it was an explicit choice not to impose a new required method on all custom widgets.

That said, I'm 100% on board with adding the propagation to EnvScope and whatever other built-in widgets it makes sense for.

from druid.

matthewgapp avatar matthewgapp commented on July 23, 2024

@sjoshid @jneem since you authored and reviewed, respectively, the PR that introduced this method, would you have thoughts here?

from druid.

sjoshid avatar sjoshid commented on July 23, 2024

Hmmm. What can't you override the blanket impl? Like, many other widgets.

from druid.

matthewgapp avatar matthewgapp commented on July 23, 2024

Hmmm. What can't you override the blanket impl? Like, many other widgets.

You can override it, but because it's not required, the widget authors may forget to implement it properly (ie, call the compute_max_intrinsic on the child), making any container widget that relies on the default implementation break the call chain and result in weird, hard-to-debug behavior. Container widgets should always propagate the calculation to its child/children but atm this isn't required.

from druid.

sjoshid avatar sjoshid commented on July 23, 2024

All out-of-the-box containers handle it correctly. If it's a custom container, the onus is on the author of that container to override correctly. Druid, at the end of the day, is an opinioned framework.

Besides, if you remove the blanket impl, every widget out-of-the-box or not, must have an impl. What should be this default impl?

from druid.

sjoshid avatar sjoshid commented on July 23, 2024

Also, I havent used Druid in a long time. If @jneem thinks what you propose makes sense, I have no objection. :)

from druid.

matthewgapp avatar matthewgapp commented on July 23, 2024

All out-of-the-box containers handle it correctly. If it's a custom container, the onus is on the author of that container to override correctly. Druid, at the end of the day, is an opinioned framework.

Yeah, maybe it's just a matter of educating authors and fixing up the widgets in /widget that don't properly propagate the calculation. Any widget that contains a child widget or a child WidgetPod should call the compute_max_intrinsic. Taking a glance at /widget, it appears most don't properly call compute_max_instrinsic but instead rely on the blanket implementation. So they should be fixed up.

from druid.

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.