Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

Add proper support for variable referencing within array items #108

Closed bob2517 closed 3 years ago

bob2517 commented 3 years ago

Works fine with objects. Avoid arrays until this fixed.

Breaking scenario:

var: toDoItems["{thisID}"] { title: "{toDoString}", completed: false };
bob2517 commented 3 years ago

On any and all array related bugs now. This should be easy enough to solve now that there is a new self-contained internal _getScoped() function.

bob2517 commented 3 years ago

Back on this one. Am now using lodash get and set functions in the core which should sort arrays out on a base set and get level.

bob2517 commented 3 years ago

This is almost done offline now. Reactivity now works correctly with var changes like {{theLen['a val']['a 0']}}. The errors were due to limitations in observableslim in handling array changes, and the get and set methods (none of which I actually wrote myself - I'm just saying that in case any recruiters think I'm shit at coding - these are literally the only 3rd party code used in acss and I've now migrated to lodash get and set (minus symbol functionality) - I'm not writing those from scratch when it's tried and tested in lodash - and written workarounds for limitations in observableslim). Things should be a lot stabler now anyway.

Just one little weirdness to clear up on one of the examples and that should hopefully be in for this major fix. I'm not going to speak too soon though. I'll wrap up the todo example first, which brought up this issue in the first place. I'm like sick of trying to fix array handlings.

bob2517 commented 3 years ago

Tentatively marking as done offline. Will commit fix a bit later unless anyone yells for it earlier.

bob2517 commented 3 years ago

Doh - haven't added support for variable referencing within array items yet. That was the original point of this but got distracting by an underlying issue. Now to tackle the issue itself...

Re-assigning as an enhancement, as this is new syntax.

bob2517 commented 3 years ago

Just object key variable references to sort out on this one.

bob2517 commented 3 years ago

This looks like it was fixed as a result of a prior commit, so marking this as done on branch.