Skip to content
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

RFC: Use es6 proxy #245

Closed
poteto opened this issue Dec 13, 2017 · 6 comments · Fixed by #379
Closed

RFC: Use es6 proxy #245

poteto opened this issue Dec 13, 2017 · 6 comments · Fixed by #379
Labels

Comments

@poteto
Copy link
Collaborator

poteto commented Dec 13, 2017

Didn't have time to write up an actual RFC. Here's a quick proof of concept where we are just naively trapping proxy.set to validate prior to setting the value on the target object.

If we go down this route, we should implement that as a separate JS library and then have this addon consume that.

@poteto poteto added the RFC label Dec 13, 2017
@krishandley
Copy link
Contributor

That would be nice, my only question is what do we do about IE11?

@webark
Copy link
Contributor

webark commented Dec 13, 2017

could this be something where we could base it off of the Proxy object, but fall back to a polyfill like https://github.com/GoogleChrome/proxy-polyfill

@nucleartide
Copy link
Contributor

This is great 🙂 I think we could continue the bug-fixing efforts with nested keys and get a release out, then focus on integrating validated-proxy? It'll be easier since we'll already have defined nested keys behavior.

@poteto
Copy link
Collaborator Author

poteto commented Dec 15, 2017

This isn't a mandate by any means, I'm using validated-proxy as an experiment. I wouldn't change any plans yet! That said, I wanted to start a discussion and I will soon add a real RFC into my first comment

@nucleartide
Copy link
Contributor

Having looked through validated-proxy a bit more, I think it’d be interesting to explore use cases. An obvious one is using validated-proxy with Redux, where you’d emit actions only when data is valid. Since we’re not coupled to Ember anymore, maybe an Express middleware for validated-proxy would be useful too. I’m curious what people have used Ecto.Changeset for, since all those use cases would apply here.

As an aside, one of my goals is to capture UI use cases in ember-changeset’s wiki going forward.

Implementation-wise, I’m all for having ember-changeset consume validated-proxy. We’d still need some Ember-specific stuff like relays, but it’d definitely clean up the code. Not to mention the TypeScript typings look really nice.

@snewcomer snewcomer mentioned this issue Jul 6, 2018
8 tasks
@snewcomer snewcomer mentioned this issue Sep 11, 2018
@sandstrom
Copy link

sandstrom commented Sep 30, 2019

This sounds awesome! Would this help with the issues around 'deep set'?

Proxy seems to have great browser support :https://caniuse.com/#search=proxy

IE 11 is quickly on its way out:
https://support.zendesk.com/hc/en-us/articles/360002084367-Removal-of-support-for-Internet-Explorer-11
https://blog.developer.atlassian.com/retiring-ie11-support-for-atlassian-cloud-server-and-data-center-products/

Something "opt-in" that people with min browser requirements > IE 11 could use would be lovely 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants