-
Notifications
You must be signed in to change notification settings - Fork 217
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
Replace dirty checking with Proxy object #96
Comments
There might be a problem with
This means that we will not be able to add traps to properties added after the initial page load. Maybe actually we can achieve what's needed by forking |
Also, the performance cost of Proxy is quite significant: http://jsperf.com/es2015-proxy-test3. But I haven't yet compared it to the cost of dirty checking. |
Palindrom/Palindrom/issues/98 Partialy reverts Starcounter-Jack/JSON-Patch/commit/81ede07d94305bbdc53cf449717e7c3f4294cb46 (/issues/98)
I know that some other frameworks attempted adapting Proxy and failed: vuejs/vue#3020. But perhaps our case is different. |
What is 'our case'? |
Deep observing of a plain Javascript object without modifying it. |
Yes. Patch generation using ES6 Proxy was implemented as a separate package: https://github.com/Palindrom/JSONPatcherProxy In this repo we continue to have dirty-checking based patch generation, but it will be deprecated in future. Follow #151 |
Proxy is a ES2016 feature that can replace dirty checking in https://github.com/Starcounter-Jack/JSON-Patch/blob/master/src/json-patch-duplex.ts
I think that the correct way is to replace the current dirty checking recursively with Proxy objects. The support in old browsers should be provided with a polyfill.
First step is to make a proof of concept implementation and check if the polyfill is capable of running it.
Read more:
The text was updated successfully, but these errors were encountered: