Comments (7)
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.
@sjoshid @jneem since you authored and reviewed, respectively, the PR that introduced this method, would you have thoughts here?
from druid.
Hmmm. What can't you override the blanket impl? Like, many other widgets.
from druid.
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.
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.
Also, I havent used Druid in a long time. If @jneem thinks what you propose makes sense, I have no objection. :)
from druid.
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)
- Can't compile the program in Chapter 2 of druid book HOT 1
- Docs? HOT 2
- Broken links in the book.
- Window name is not null terminated in X11 HOT 3
- Build error of an empty project: `syn::Type` doesn't implement `Debug` HOT 7
- Issue building druid-derive on macos HOT 1
- App update upgrade features HOT 1
- do we stop to develop the project? HOT 1
- Read data from an other thread HOT 3
- Looks like the documentation is out of date HOT 1
- Opening another window within a Druid application.
- Dual monitor App invisible
- version `GLIBCXX_3.4.29' not found HOT 2
- assertion 'width >= -1' failed on NixOS/Sway HOT 1
- Prevent closing app with cross
- expected tuple struct or tuple variant, found struct variant `KbKey::Character` HOT 3
- Scroll to bottom on dynamic content HOT 1
- Druid ignoring custom painter HOT 1
- Druid does not allow low window sizes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from druid.