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

Remove jQuery from tutorial #603

Closed
Daniel15 opened this issue Nov 25, 2013 · 7 comments
Closed

Remove jQuery from tutorial #603

Daniel15 opened this issue Nov 25, 2013 · 7 comments

Comments

@Daniel15
Copy link
Member

This may be controversial, but after browsing StackOverflow I believe there's way too many people that load jQuery when they really don't need it. Let's not add to that. I don't think we should be loading jQuery in the tutorial just to do an AJAX request. Let's instead have a dummy object that just returns a static list.

var CommentsService = {
  data: [...hardcoded data here...],
  getAll: function(callback) { callback(this.data); }
  // ...
};

Which could simply be replaced to implement AJAX loading.


Old post (before I thought of just using static data):
Let's replace it with standard XMLHttpRequest code and say something like "Here's some simple code for doing an AJAX request, alternatively you could use your favourite framework like jQuery, MooTools, YUI, ... instead". Having jQuery loaded in the tutorial may make people think that jQuery is necessary to use React.

@Daniel15
Copy link
Member Author

I was thinking about this more and using a static list would probably be better than AJAX (given the tutorial just AJAX loads a static file). Updated the description to reflect this.

@zpao
Copy link
Member

zpao commented Dec 3, 2013

I think that would be fine. I would still put the equivalent jQuery call because that will be the inevitable question.

@jstoja
Copy link

jstoja commented Aug 1, 2014

After reading pretty much everything related to this issue, I think it would be a good idea to add (for now) a little note in the tutorial, just under the code snippet having the jQuery inclusion.
I think it's the only place it really needs to be.
What do you think ? (So we can finally close this issue)

@chenglou
Copy link
Contributor

chenglou commented Aug 2, 2014

Agreed. A beginner tutorial isn't the place to debate jquery vs no jquery. The point is familiarity.

@Daniel15
Copy link
Member Author

Daniel15 commented Aug 2, 2014

For what it's worth, I removed the use of jQuery in the ReactJS.NET version of the tutorial: http://reactjs.net/getting-started/tutorial.html#updating-state

jstoja pushed a commit to jstoja/react that referenced this issue Aug 2, 2014
…rm that jQuery is not mandatory.

It's linked with facebook#603
zpao pushed a commit that referenced this issue Aug 12, 2014
…rm that jQuery is not mandatory.

It's linked with #603

(cherry picked from commit 5eca8d6)
@chenglou
Copy link
Contributor

^ The note about jQuery not being mandatory got merged. I think this is good for now for newcomers. The react users probably already realized they don't actually need jQuery. Closing for now! =)

@Andersos
Copy link

It dose not look very good when you are introducing new people to React and the first ting in the tutorial is: "We need to do some Ajax calls, let's just add jQuery".

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

Successfully merging a pull request may close this issue.

5 participants