3 ms·
i am not super good at explaining this point. if components get complex (think about a buffered grid, the helix, the DatePicker with complex animations) you can
by tobiu 7y ago
i am not super good at explaining this point. if components get complex (think about a buffered grid, the helix, the DatePicker with complex animations) you can end up with a huge amount of templates. you do not want to create massive amounts of child components (possible memory leaks), so you might end up with templates of several 100 lines and tons of if else.
there is a trade off point where it is less and cleaner code to manually deal with the json structures. sure, you can also manually change the generated jsx output, but i would argue that you need to do it in a different way (not consistent), while you can do this the same way in neo throughout the cmp lifecylcle.
now think about charts, like amCharts (just created the wrapper code):
https://github.com/neomjs/neo/blob/dev/examples/charts/MainContainer.mjs https://github.com/neomjs/neo/blob/dev/examples/charts/MainC...
putting the json config of a chart into the json component tree has its beauty. the same goes for mixing the json based cmp and vdom tree. (the chart lib runs inside the main thread while you define you chart inside the app worker).
if many devs really want to use jsx with neo and accept a build process as the price, i would not mind if someone starts to work on making it happen. as long as it is optional.
- mst 7y agoYep, I absolutely see what you mean ... but the point here is you're talking about text templating, then you use a jsx example, which isn't text templating. I believe I understand what you're trying to say ... but the way you've said it ends up including a giant factual error that will potentially put people off. I figured it was "not super good at explaining" so thought I'd mention it so you could try and fix it (I'd be happy to help review an updated version, btw).
- tobiu 7y agoif you have an idea in mind, PRs are welcome :)