본문 바로가기
Study

[article] Replace Create React App recommendation with Vite

by 안자두 2023. 3. 3.

🌞 Article

👇 link

https://junghan92.medium.com/%EB%B2%88%EC%97%AD-create-react-app-%EA%B6%8C%EC%9E%A5%EC%9D%84-vite%EB%A1%9C-%EB%8C%80%EC%B2%B4-pr-%EB%8C%80%ED%95%9C-dan-abramov%EC%9D%98-%EB%8B%B5%EB%B3%80-3050b5678ac8

 

(번역) ‘Create React App 권장을 Vite로 대체’ PR 대한 Dan Abramov의 답변

PR 링크: https://github.com/reactjs/reactjs.org/pull/5487

junghan92.medium.com

https://github.com/reactjs/reactjs.org/pull/5487#issuecomment-1409720741

 

Replace Create React App recommendation with Vite by t3dotgg · Pull Request #5487 · reactjs/reactjs.org

Create React App is not a great recommendation to be making, especially for newer developers. As an educator, I run into countless issues w/ new React devs running into unnecessary issues due to th...

github.com

 


💬 정리하기

 

사실 나도 CRA를 사용하면 편하긴 하지만, Webpack 빌드 속도 때문에 따로 Vite로 boilerplate를 만들어 사용하고 있던 터라, 이 기사의 제목이 충분히 흥미로웠다.

 

결론적으로는 아래 다섯 가지의 옵션 중, 다섯 번째의 의견으로 기울고 있다고 한다.


Option 1: Create a new framework from scratch

We could try to rearchitect Create React App as a framework that integrates data fetching, routing, bundling, and SSG/SSR. Building a high-quality new framework at the intersection of these concerns is a huge undertaking, requires a lot of specialized ecosystem expertise, and even if we stopped other projects to pull this off, there is a significant risk it would become stagnant over time like Create React App itself did. It would also further fragment the ecosystem with yet another framework that is officially recommended despite having no real users. We don't think this option is practical at this time.

Option 2: Deprecate Create React App, maintain a Vite template

We could deprecate Create React App and instead maintain our own Vite template. To achieve the stated goals, this template would have to be very sophisticated. In fact, it would have to be as sophisticated as a React framework — and impose opinions about routing, data fetching, etc. That leads to the same issue: we'd effectively be creating another framework.

Option 3: Deprecate Create React App, suggest React frameworks

We could deemphasize or deprecate Create React App as a tool, and emphasize React frameworks more actively. This doesn't mean you would have to use a framework with React, but that we would suggest using one of them for most apps. The downside is we'd no longer have a neutrally branded CLI "gateway" to creating a React app: you'd have to find the right one in the corresponding framework's docs. Outright deprecating is also disruptive. We'd need to keep the command working for a long while — which is confusing from the branding perspective ("why is creating a React app deprecated?")

Option 4: Make Create React App use a single framework

We could pick a single designated framework, and change Create React App to create apps with that framework by default. The main problem with this approach is that it makes it very difficult for other solutions to compete — especially if they have slightly different tradeoffs but are roughly the same in popularity, feature set and quality. Such a change in behavior would also have to be pretty disruptive since all the old tutorials would break in a non-obvious way.

Option 5: Turn Create React App into a launcher

We could keep Create React App as a command, but turn it into a launcher. It would suggest a list of recommended frameworks, followed by the "classic" framework-less approach being the last option. That last "classic" approach would produce a client-only app like CRA does now (to avoid breaking tutorials), but could eventually move to Vite under the hood.

To get on the curated frameworks list, a React framework would have to meet certain criteria — similar to what de facto happens with this documentation page. We would need to consider popularity and adoption in the community (to keep the list short), feature set, performance characteristics, ability to take full advantage of the web platform and React itself, whether it's actively maintained, and whether it is clear how to host it on a variety of hosting services and environments (to avoid any vendor lock-in). The starter template for each framework would be maintained by the React team to ensure they have consistent design and branding, don't link to commercial services, and are similarly structured. We would need to clearly communicate to the community about how we arrived at our choices, and we would periodically reevaluate them.


 

중간중간 아직 학습이 부족하다고 느낀 부분이 많지만, 리액트 측의 답변 토대로 생각해보자면, 나는 리액트의 방향성에 대해 제대로 모르고 있었던 것 같다.

The original goal of Create React App was to provide the best way to start a new React web app for the majority of React users.

 

인용 문구처럼 다섯 번째 의견이 원래의 목표에 가장 걸맞은 방향이 아닌가 싶다. 나도 CRA로 리액트를 익힌 후, 다른 것들을 조금씩 바꿔봤던 것 같다.
리액트는 라이브러리이기 때문에 어떤 프레임워크를 갖다붙여도 호환이 쉬워야 하고, 앱의 상황에 맞게 각기 다른 프레임워크를 사용하는 것이 보다 효율적이라고 생각한다. 

 

리액트 측의 전체 사고 과정을 알 수 있었던 글이었다. 그동안의 작은 궁금증 또한 해결할 수 있었던 좋은 글이었다.
아직 부족하지만 한 번 더 읽은 후, 생각을 더 정리해보아도 좋을 것 같다.👀

728x90