-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best practices for measuring? #108
Comments
The simplest approach to 'positioning' as you call it is to let the CSS do the hard work. When using CSS's flexbox, you can define how elements should grow and shrink to accomodate viewport sizes. If you need to be even more flexible and want to measure elements and modify dimensions accordingly, you could easily get problems with performance. If you change the DOM, measure an element and then change the DOM again, you are causing an expensive 'reflow'. This is why you should preferably not perform measurements (like At @AFASSoftware we do measurements. Therefore we use a slightly modified version of the Projector combined with custom callbacks on VNodes. The projector first does the normal render+diff+patch, then executes newly added measure callbacks, if any, and then does a render+diff+patch again (if there were measure callbacks executed). |
Thanks for the information. Despite my poorly named issue, you addressed the real matter at hand (measuring with maquette). 😄 I'll update the issue accordingly. BTW, are there any plans to update maquette with the modifications you described? If not, it'd be very informative to see an example of this. |
The modified version of the projector (maquette is built with the possibility to use your own projector) is not something we would like to give support on, because it would probably raise too much questions. I am surprised that there are more people out there who are willing to go down the 'measure and modify' route, because it is a pretty complex one. Using maquette makes it a little easier, but still... Why do you want to do measuring? |
@jcfranco We want to address measuring DOM Nodes in Maquette 3.0 and would like to have your input on this. |
@RickHoving @johan-gorter Apologies for the belated response. It looks like Maquette 3's new render cycle would fix my original issue. 🎉 |
Do you have any recommendations for
positioningmeasuring? If so, it'd be a great addition for the cookbook.The following toy test case shows a problem where
usingmeasuring is done within astyles
for positioning may not work if thatrender
call that also applies classes that invalidate the measurements.I guess, one workaround would be to do the inline positioning directly on the element withinafterUpdate
, but that seems to be going against the maquette-way™.indented = added
The text was updated successfully, but these errors were encountered: