-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Initial add of React TodoMVC to labs #582
Conversation
@@ -141,5 +142,5 @@ Check out our [contribution docs](contributing.md) for more info. | |||
|
|||
## License | |||
|
|||
MIT License | |||
MIT License |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, made this fix. Also fixed an issue with spaces instead of tabs in the index.html file.
Thanks for the submission, @petehunt! A few notes:
|
Thanks for the submission, Pete. I was actually quite interested in looking at the Backbone integration example to see how it compared to other extension frameworks. Would it be possible to get another labs PR for it? As @passy mentioned above, there are a few more changes we would love to land in order for it to meet our specs, but as this is a labs submission it really depends on how soon you think you might be able to get around to making the updates. |
Sure, I figured I'd land this one first so the second one could go more smoothly. I'll take a pass at it in the morning as I'm totally beat from the launch today, but if you'd like to take a peek at our Backbone integration it's here: https://github.com/facebook/react/blob/master/examples/todomvc-backbone/js/app.js |
@passy It's pretty hard for me to get this to pass jshint because when I desugar jsx syntax, the desugared code doesn't pass it (superficial things, like whitespace). I think I'm pretty close to the coding standards now, though. |
@petehunt Oops, didn't even think about that. Thanks for the update! I'm going to take a closer look today and leave comments at the relevant places. |
Another option is I could desugar the jsx and check in raw JavaScript that meets the guidelines, but I don't think that's in the spirit of TodoMVC since the preferred way to write React right now is to use JSX (though you don't need to use it if you don't want to). Sounds like this approach is at least good enough for labs, but let me know if you want me to change it up. |
@petehunt Yes, we'd definitely prefer a version that you would consider an example of the framework's best practices. |
Hey @petehunt, I went through the app to try to accomplish a few things:
Check it out and let me know if I broke any React principles in the process, since we don't want that! |
@stephenplusplus that looks great! A few things (my bugs to begin with):
But those aren't real bugs and aren't too bad. What may be easiest is if you committed that, and I could put out a pull immediately after to clean those up. |
Glad to hear I didn't mess anything up! :) Instead of leaving the trail in this repo's history, it would work just as nicely if you just did a...
Then you can edit away, squash, and force push to petehunt/react to update this PR. |
Ping :) would be great to keep the momentum going on this implementation. |
My bad! Pushed @stephenplusplus's version with a few minor tweaks. This is what happens when I don't put something in an issue tracker :P |
@petehunt last thing is just squash 'em down to 1 commit, please :) |
Oops, should be good now :) Thanks for being patient! |
Thank you as well for being so patient! :) I did run into a few issues though.
If you need any clarification, please let me know! |
Cool. I will try to finish this up this weekend. Thanks again |
OK. I addressed your comments. I also re-ran through all the behaviors in https://github.com/tastejs/todomvc/wiki/App-Specification and fixed the escape key behavior. This should have everything but routing, which React doesn't really want to solve (better to delegate to a tool that's solved it thoroughly, imo). What are people's thoughts on Selenium integration? I poked around but it seemed like there was tons and tons of discussion but not necessarily a conclusion. If I can find some time I may take a shot at it, but I want to make sure it's something that people want. |
Any help on the testing topic would be greatly appreciated. We still haven't found a good solution for end to end testing, but if you can provide an example of how to do that with selenium - specific to the React example or generic -, that would be fantastic. |
Side: I wonder if it's worth us punting on Selenium integration for TodoMVC in favor of doing this instead for TasteApp (our next, more complex version of this project) (tastejs/TasteApp#1). As it's a completely fresh application we may be able to design it from the ground up with such integration in mind. I personally wouldn't mind better testing for TodoMVC regardless if someone was interested in exploring however :) Great work once again on addressing the issues above, @petehunt! |
Two things I found:
|
React is a JavaScript library for building user interfaces by Facebook and Instagram. It powers many components on Facebook.com and all of Instagram.com is written with it. We have two TodoMVC examples checked into our repo: this one, which has no dependencies, and another one which showcases Backbone integration. I've only included the first one for now, if you guys think it's a good idea I can put out a PR for the one with Backbone integration. I read the contributing guide and I think this meets the standards, let me know if I missed something.
Added trimming and fixed the input element bug. That's a React gotcha that will be fixed in our upcoming release but I corrected it in the latest update. |
I hope this isn't some caching issue on my end, but when I add a new todo, edit it and add some spaces to the end, save it and enter edit mode again, I still see those spaces. They don't seem to be persisted, though. |
Hmm really? I just tested that behavior and it seems to work. What browser? |
@petehunt Chrome 27.0.1453.110 |
@passy I can't repro with that Chrome version or Firefox (both mac). I know a common configuration is to run python -m SimpleHTTPServer. I've had issues with Chrome wanting to cache that stuff indefinitely sometimes. I wonder if that's an issue. |
Just tried freshly checked this out on my desktop computer and everything works as it should. This must indeed had been some caching issue. Thanks so much for the hard work, @petehunt. And thanks for the support, @stephenplusplus. 🍻 |
Thank you guys for helping out and being patient! Big fan of what you're doing here. Specifically I think it's really great that you're valuing the little details that tend to be overlooked in simple examples but bite you in real apps :) Will chew over the testing stuff and hopefully spin up a conversation with you guys. What would be the best medium for that? |
If you have some code to show, a pull request is probably best. If you just need a little input, you can ping all of us on Twitter or GTalk. :) |
Thanks this addition @petehunt :) |
React is a JavaScript library for building user interfaces by Facebook and Instagram. It powers many components on Facebook.com and all of Instagram.com is written with it. We have two TodoMVC examples checked into our repo: this one, which has no dependencies, and another one which showcases Backbone integration. I've only included the first one for now, if you guys think it's a good idea I can put out a PR for the one with Backbone integration.
I read the contributing guide and I think this meets the standards, let me know if I missed something.