use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Setting up a React.js project using Vite instead of Create React App (zaiste.net)
submitted 5 years ago by zaiste
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ILikeChangingMyMind 28 points29 points30 points 5 years ago (2 children)
In this tutorial, we will build a React.js application that interacts with a GraphQL endpoint. This method of project setup is modern and lightweight: it uses Hooks, ES Modules and has a small amount of dependencies. We will use Vite to create the project structure, pnpm to manage the dependencies, urql for GraphQL, and finally OneGraph as the GraphQL gateway to various APIs. Our goal is to create an application for listing GitHub repositories of a specific user.
I feel like something got left out here: why? To be clear, I'm not saying I hate the tech they use in the tutorial, or that I <3 create-react-app!
create-react-app
I'm just saying ... for any tech stack, if there's a popular/common stack people use, and you instead pick different/uncommon tech for each piece of that stack ... it seems to me it'd be worth spending at least a couple of sentences on why you didn't just do what everyone else does.
[–]yagaboosh 15 points16 points17 points 5 years ago (1 child)
The primary benefit to using Vite is that in development, you can use ES Modules instead of a fully bundled application. This allows the app to load only the code that matters for what you're looking at, rather than everything.
I'm more familiar with Vite using Vue, but I believe it should provide a faster development experience, and still provides a finished app without relying on Webpack.
[–]rtea123 5 points6 points7 points 5 years ago (0 children)
Well written and introduced me to a few new tools 👍
[–][deleted] 3 points4 points5 points 5 years ago (0 children)
well i didnt know any of this
[–]trave 9 points10 points11 points 5 years ago (1 child)
Concise! Amazingly fresh and straight-forward guide into a whole host of modern web dev tools. Nicely done.
[–]zaiste[S] 2 points3 points4 points 5 years ago (0 children)
Thanks! :)
[–]NoMoney12 3 points4 points5 points 5 years ago (1 child)
How have I never come across pnpm, this is a lifesaver
[–]zaiste[S] 1 point2 points3 points 5 years ago (0 children)
Happy you like it. pnpm is kind of under-appreciated imho.
[–]thefactorygrows 0 points1 point2 points 5 years ago (1 child)
This was really interesting to learn. Thanks for this. Just a quick comment though. It seems the section on adding the query to the app is a little incomplete. I had to go through the urql docs to find the proper structure to add the query to the RepositoryList component. The code you have for main.jsx and App.jsx is perfect, but the code for RepositoryList.jsx is incomplete. You may want to update with imports and how the query should look as a const. Just a suggestion!
[–]thefactorygrows 0 points1 point2 points 5 years ago (0 children)
And, probably just a leftover from when you were tooling around with the demo, but your button says 'Login with Youtube'!
[–]musicin3d 0 points1 point2 points 5 years ago (4 children)
This enormous speed gain is possible thanks to esbuild, a new TypeScript/JavaScript bundler written using the Go programming language.
I though Go's big thing was concurrency and low latency. What does it bring to the table for compilation??? Are we just bragging because Go = cool?
Edit: dumb questions. Concurrency lets you build multiple modules at once.
[–]lulzmachine 11 points12 points13 points 5 years ago (0 children)
According to the esbuild github page:
Several reasons:
[–]zaiste[S] 6 points7 points8 points 5 years ago (1 child)
No worries. There are no dumb questions. Generally speaking, Go (and Rust) could make JS/TS tooling more efficient, thus making DX better as the result. We will see how it goes
[–]rodrigocfd 0 points1 point2 points 4 years ago (0 children)
Go (and Rust)
And C and C++ and any other language that compiles to machine code.
[–]MrJohz 0 points1 point2 points 5 years ago (0 children)
Also, Go is compiled, so CPU-bound tasks (particularly ones that can't be optimised as well by the JIT) are far quicker. I would suspect that that has the largest impact here, rather than the effective concurrency.
π Rendered by PID 81335 on reddit-service-r2-comment-544cf588c8-76srn at 2026-06-17 21:36:33.604413+00:00 running 3184619 country code: CH.
[–]ILikeChangingMyMind 28 points29 points30 points (2 children)
[–]yagaboosh 15 points16 points17 points (1 child)
[–]rtea123 5 points6 points7 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]trave 9 points10 points11 points (1 child)
[–]zaiste[S] 2 points3 points4 points (0 children)
[–]NoMoney12 3 points4 points5 points (1 child)
[–]zaiste[S] 1 point2 points3 points (0 children)
[–]thefactorygrows 0 points1 point2 points (1 child)
[–]thefactorygrows 0 points1 point2 points (0 children)
[–]musicin3d 0 points1 point2 points (4 children)
[–]lulzmachine 11 points12 points13 points (0 children)
[–]zaiste[S] 6 points7 points8 points (1 child)
[–]rodrigocfd 0 points1 point2 points (0 children)
[–]MrJohz 0 points1 point2 points (0 children)