-
Notifications
You must be signed in to change notification settings - Fork 50
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
Explore using ES2015 Proxies #40
Comments
Of the whole test suite, this test is the best place to get started. Disable all other tests, delete all the source code, and figure out how to make it pass with Proxies :-) |
:D I'm giving this a go now, but that shouldn't stop anyone else from taking a stab at it at the same time. |
Unless I'm missing something, the entire test suite has to be converted to run in the browser first, no? |
I don’t know, will they? If this code fails we should fix it.. I guess? I’m not sure this problem is related to Proxies though. |
Why would we run it in the browser? I want the tests to be executed in Node, like they are now. Is there no Node version with Proxies at all? That would be a bummer, and in this case, yeah, we’d have to use a browser runner like Karma. |
The latest node version doesn't look like it does. |
According to |
Didn't get very far before having to move on to something else; might have time in a week or so, but hopefully someone beats me to it. |
https://github.com/danmartinez101/react-proxy |
Would you like to send a PR just for posterity’s sake? |
A PR of the browser tests or something else? |
Sorry, I thought you meant you had some prototype working. I’m not sure browser tests alone would be very useful. Did |
Ah, yea, I had something working but I didn't save it in a memorable place because it was only partially working. I'll see if I still have it around somewhere, but my hopes are not high. :/ I didn't try too hard at --harmony_proxies because the interface was different than all the documentation I was finding and my brain is to small for all that at once. |
From what I can see, latest Node stable is using a version of V8 that doesn't support proxies as per the ES2015 spec (I think it's using the old proxy API):
V8 4.9 does support ES2015 proxies, but it was only released in late Jan, so I'm not sure when it'll turn up with Node. If you wanted to stick with Node for the tests right now, one option could be to use something like harmony-reflect, which patches pre V8 4.9 proxies to be ES2015 compliant? |
Proxies are everywhere now, I'll take a stab at this. Would love some help getting started though. I'm not sure exactly how the proxy works right now. |
Hello 😃 I would be happy to understand what's current status of the issue... @wkwiatek, is https://github.com/gaearon/react-proxy/tree/use-proxies relevant (looks like it is)? I have started to work on your branch by fixing tests, but i am not sure my effort is worthy. How does this issue plays together with the recent changes, e.g. |
Hi @agoldis I've started evaluating proxies and it turned out that it's actually much bigger topic than I though and simply have no time to push it forward to the state that I wanted (and I'm still very busy know). The point is, it's totally rewritten. It's also a little bit different approach as I started to render components using Enzyme to get the desired output and propagate it to the existing proxy component (it's due to e.g. arrow functions lexical context). If you're willing to push it forward, I'd be happy to walk you through the code and show you what's going on there. The most recent state should work when swapping components (even connected by Redux) but still needs a lot of testing and fixing tests. |
@wkwiatek Thank you for reply. There are some tests, thought, that i am not sure should be maintained - e.g. That's why i am wondering whether it's important to keep backward compatibility and we can just move forward and make all the tests pass just with the modern non- Anyway's I'll start to open PR's with small code changes and fixed tests. |
I think we can just move forward and even prepare it to be React 16 only. People using RHL are rather early adopters, and in my opinion, the best recommendation for using RHL should be: it just works (even for a limited environment first) or says no. |
They might make a ton of things easier.
We can fall back to the old method if they are unavailable.
I don’t have time for this right now but it’s a perfect opportunity to get involved with the project.
The tests should pass :D
If you decide to play with it, please post in this thread so we don’t duplicate the effort.
The text was updated successfully, but these errors were encountered: