-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Change all apis on the Change, Data, all internal structures to be Symbols in order to not conflict with passed in data #122
Comments
This seems like a great idea! I'll get to working on this in the next few days! |
Or of course, PRs are welcome! |
@NullVoxPopuli A few thoughts.
|
|
Another possible approach is the change the api a bit, which would be breaking. The root of the issue right now is that changeset[property] proxies to the underlying data. If we forced using some other property and proxy that, problem solved. Similar to .get, except not using get. |
Class based inheritance should get us all the functionality we need. Prioritizing the following is probably all users need.
Can you help identify why the above prioritization might not work for a user? If we determine this is a bug (which I think it is - we prioritize Changeset over Content), then we can simply fix it. We could use something like
But my feeling is class based inheritance is sufficient in this case as long as we have the right prioritization order. Would love to hear your thoughts though! |
Well giving #123 a go! |
Alright I'm back to this issue 😆 . I completely borked the last PR b/c I thought my partner tests were passing. whispers they weren't. I'll take a look at this during the week. |
Reproduction: https://runkit.com/nullvoxpopuli/reproduction-for-validated-changeset-122
for example,
the data,
trigger
conflicts with: https://github.com/validated-changeset/validated-changeset/blob/ca0c7d249fc2244edaeb7aef25bdf06583628efa/src/index.ts#L144I propose all internal APIS be assigned to private symbols instead of regular keys to not conflict with passed data:
example:
The text was updated successfully, but these errors were encountered: