Component object backend props #6
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Accomplishes
3) BACKEND: pass data (writable props) & props separately as live controller valuesfrom symfony#500tl;dr
We now pass
props(readonlyLiveProp) anddata(writableLiveProp) separately to the frontend. But then when we re-render, we still send back just one big array of BOTH mixed together.Why do we need to differentiate between
propsanddataon the frontend? It's for child components. When a parent re-renders, we will (it's another TODO on the PR) render the parent but with an EMPTY child element, except that we will include thepropson that child element - e.g. this will come back from the Ajax request:This will allow us to grab the new props (which may have changed as a result of WHAT the parent component is passing into the child), override the props on the child, and then trigger the child to re-render with all the new stuff. What's important here is that, by differentiating props vs data, we can KEEP any modified "data" that the child has: only overriding the props that changed as a result of the parent component re-rendering.