Comments (5)
This can be solved by the community maintaining the CRA package and offering a prompt style choice as with nextjs.
While just a draft a prompt like this offers more advanced configurations such as
Federated Modules in Webpack
for microfrontends or custom builds with Metro. Besides the obvious quick vite config.
npx create-react-app
Name of your app? Is this app being built for production? Production Development Choose a Bundler Vite Babel Metro Webpack Choose 1 Javascript Typescript FlowJS
that will solve part of the problem. CRA creates lots of convince. I don't have to define proxy middleware in my webpack config file or Vite config to proxy api requests.
I just need to add, proxy
option in the package.json
having both css and scss + module support is also tricky when it comes to other bundlers, even if they offer built in support for sass, if you want to have css and scss modules together, it will create quirks.
same goes for PWA support, which needs plugin for build tools like Vite. but in CRA you can directly attach service worker to the index.html.
%PUBLIC_URL
support for index.html
is also great.
there are lots of great features.
after all, CRA saves you lots of time. I tried to build projects with Vite, Parcel and webpack (custom configuration) and no of them were straightforward as CRA. you might not see an issue in right after the project build but it will show problems throughout the project.
from create-react-app.
@Ali-Milani-13 This might be a tad out of context, but I've always been using create-react-app. Now that I'm planning to start a huge project, after lots of research and testing, I felt Vite was the way to go. However, your comments did make me hesitate. Can you explain some of these "it will show problems throughout the project" issues that you saw, for example, in Vite? Thank you!
from create-react-app.
This can be solved by the community maintaining the CRA package and offering a prompt style choice as with nextjs.
While just a draft a prompt like this offers more advanced configurations such as Federated Modules in Webpack
for microfrontends or custom builds with Metro. Besides the obvious quick vite config.
npx create-react-app
Name of your app?
Is this app being built for production?
Production
Development
Choose a Bundler
Vite
Babel
Metro
Webpack
Choose 1
Javascript
Typescript
FlowJS
from create-react-app.
Hi there.
so, these were couple of the issues I've encountered so far. ( I don't remember all of them )
- you will be heavily reliant on tools like "linter". from what I understood about hot module replacement (HMR), if you forget to import something, Vite will not have any clue about it. it won't give you any error message, just a blank page.
I've had my linter tool broken and exact same thing happened.
I couldn't even get an error on console to see what was happening. I did it with debugger and things like that to find the issue.
CRA only gives you blank page if you have uncaught exceptions and even then, you can check your console and find the exact issue.
-
same goes for
index.html
file. you can work it the way you do in CRA. for example, withPUBLIC_URL
. you have to configure module bundler (vite.config.js
) if you want to do something withindex.html
. as I said I can't really afford this time to put on it. -
if you use css and sass modules together, it will introduce lots of bugs. although this issue is not unique to Vite. Parcel and Rsbuild have the same issues even if you manually create your own webpack react project, it will also cause this issue. so, only CRA works with it fine.
-
as far as I know, source mapping is still problematic in Vite. I haven't encountered any issue with source map on CRA.
I don't want to mock any open-source project. keep that in mind. for my use case, I really want to stick with CRA. so, if Vite floats your boat, go for it. since CRA is extremely slow during dev mode + tailwind doesn't go well with CRA because of postCSS issues.
so, you have to make your own decision. what everything comes with tradeoff.
I traded couple seconds of build and compile time + EXTEREMLY large module bundler to have a framework like experience and everything just works.
keep that in mind. I consider CRA as a "semi framework" for React. it has its own structure and capabilities. but once you want more or a little bit customization, you will have to either eject
it or use react-app-rewired
.
from create-react-app.
@ahmadi3d
right now, my only problem are the security vulnerabilities because of outdated dependencies and if CRA fixes this issue, it still worth and I will continue using it.
I believe to what I've said in my bio.
from create-react-app.
Related Issues (20)
- [https://newsroom.spotify.com/news/](https://deezer.page.link/fCBsxrTRUZvKbLkA8) HOT 3
- react-scripts/v/5.1.0-next.14 contains multiple security vulnerabilities for inner modules
- Issue in creating react app HOT 4
- cra打包路由切换FiberRootNode会新增,webpack打包就不会 HOT 1
- Error -4048 and Error -4058 and ENOENT, HOT 1
- Des erreurs apres installation de mui sur un projet React 18.0.0 ou supérieur HOT 1
- del proyecto
- how i can run react program in vs code HOT 5
- React JS HOT 4
- @babel/plugin-proposal-private-property-in-object missing from babel-preset-react-app dependencies HOT 1
- Npx create-react-app: 8 vulnerabilities (2 moderate, 6 high) in new react app HOT 3
- 不动 啊 HOT 1
- React Application Embedded Script HOT 1
- Allow user to config publicPath of webpack and set its default value to auto
- Cannot find module 'ajv/dist/compile/codegen' HOT 2
- I am so angry i just cant take it HOT 2
- An Error HOT 1
- Bad Resource link in https://create-react-app.dev/ HOT 2
- About deprecated packages HOT 1
- Is there a good fork of CRA? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-react-app.