Skip to content

WIP: Data Binding#25

Open
martindale wants to merge 6 commits intomasterfrom
client-resources
Open

WIP: Data Binding#25
martindale wants to merge 6 commits intomasterfrom
client-resources

Conversation

@martindale
Copy link
Copy Markdown
Member

This is a hand-rolled implementation of data binding, implemented as follows;

  • Expect DOM elements to be [data-model=ResourceName][data-path=/plural-or-singular-id-path]
  • Create in-memory "Model", and;
    • attach Object.observe or Array.observe to trigger events on their changes.
  • Subscribe to /plural-or-singular-id-path via WebSockets
  • Receive JSON-RPC patch methods, that;
    • provide data encoded in JSON-PATCH format
  • Modify in-memory "Model" by applying the JSON-PATCH
  • Re-render the appropriate template to the selected DOM location.

Frankly, this is an extremly naïve approach, but it's working. Definitely due for some benchmarks and comparisons against React and Angular 2.0.0.

Feedback welcome.

@martindale martindale mentioned this pull request Aug 10, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant