Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • React Tutorial
  • React Exercise
  • React Basic Concepts
  • React Components
  • React Props
  • React Hooks
  • React Router
  • React Advanced
  • React Examples
  • React Interview Questions
  • React Projects
  • Next.js Tutorial
  • React Bootstrap
  • React Material UI
  • React Ant Design
  • React Desktop
  • React Rebass
  • React Blueprint
  • JavaScript
  • Web Technology
Open In App
Next Article:
What's new in Create React App 2.0 ?
Next article icon

What's new in Create React App 2.0 ?

Last Updated : 06 Jan, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

Those who don't know create-react-app is the CLI or the command-line-interface tool that's used to generate React applications and just makes things much easier than opposed to setting your own web pack configuration.

Package Update :

  • Babel 7
  • Webpack 4
  • Jest 23

Babel: Browser support for modern features of JavaScript has gotten better recently but it's never going to be perfect. We can patch in polyfills or use a little shell script to rewrite our code but those are prone to breaking leading to dead code. Babel is a solution to this problem by taking modern JavaScript and compiling it down to a form that could be understood in different environments. Babel is built on a plugin system that parses our modern JavaScript into an abstract syntax tree or AST and rewrites it into a version that can be interpreted by our browser. To set this up install the babel CLI package and save it as a dev dependency.

npm install --save-dev babel-cli

In other words, it is used to compile newer es6 plus features of JavaScript to be used in all browsers. Version 7 of Babel is faster than previous versions as it has some new features that are that have been added. 

Webpack: It is a module builder i.e., webpack is a tool we use during the development of our code and is used during runtime of our assets. Web pack not only just builds your code but also manages your code. It allows us to create awesome web applications managing all our style and JavaScript files mainly but not limited to that. 
 

Webpack is used for bundling.

Jest: Jest is used for testing, it includes new features like interactive snapshot mode and custom matches. Jest works with projects using: Babel, TypeScript, Node, React, Angular, Vue, and more!

  • Version 1 of create-react-app had sass integration but there was some additional configuration that needed to be done. With version 2 we can simply install "node-sass" and we can rename our .CSS files to.SCSS. So it makes working with sass easier.
  • CSS's modules allow us to use the same CSS classes across different files without having to worry about conflicts or issues. CSS modules work right out of the box with create react app so you can just import the module using the syntax as shown, [Name].module.scss or [Name].module.css.
  • So in addition to sass integration and CSS modules we also have smaller CSS bundles, we can target modern browsers with our package.json file in the browser list specification. So we can adjust our styles to only target either the WebKit prefix or the MS prefix whenever necessary.

package.json:

{ "name": "my-project", "version": "0.1.0", "private": true, "dependencies": {   "@testing-library/jest-dom": "^4.2.4",   "@testing-library/react": "^9.5.0",   "@testing-library/user-event": "^7.2.1",   "react": "^16.13.1",   "react-dom": "^16.13.1",   "react-scripts": "3.4.3" }, "scripts": {   "start": "react-scripts start",   "build": "react-scripts build",   "test": "react-scripts test",   "eject": "react-scripts eject" }, "eslintConfig": {   "extends": "react-app" }, "browserslist": {   "production": [     ">0.2%",     "not dead",     "not op_mini all"   ],   "development": [     "last 1 chrome version",     "last 1 firefox version",     "last 1 safari version"   ] } }
  • Post CSS has also been added to create a react app too.
  • So if you have used version 2, the first thing you probably noticed was the landing page change which is now more simplistic and cleaner look or cleaner page as shown below :
Version 1
Version 2
  • There are also been changes with how service workers are implemented version 2 now uses Google's workbox which is a set of libraries for caching offline assets and working with service workers in a more elegant way than sw-precache and it will make it easier for us to create progressive web applications using the React library.
  • There's now added support for configuring our own proxy with express and a full-stack app, so we can use like the HTTP proxy middleware module and then create a file on your client in your React application right inside the source folder called setupProxy.js rather than defining a proxy object as we would before.
  • We can now use packages written for the latest Node versions.
  • We can now import an SVG as a React Component unlike before where we import an SVG and add it to the source attribute for an image but now we can just import it and use it as an actual component.
  • There is also something called yarn plug-n-play, usually, when we run yarn install, all our packages are installed and then cached inside the node modules folder with plug-n-play instead of doing that, a new file that contains static resolution tables is created and this file contains what packages are available on the dependency tree, also includes how they are linked and where they are located.
  • Node 6 no longer supported.
  • Support for older browsers (IE 9 to 11) needs to separate packages.
  • Support for.mjs extension was removed.
  • Support for the proxy object has been replaced with custom proxy support.
  • PropTypes definitions are automatically stripped out of production builds.

Next Article
What's new in Create React App 2.0 ?

R

rgndunes
Improve
Article Tags :
  • Web Technologies
  • ReactJS

Similar Reads

    npm create react app
    The create react app is a tool used to create a new React Project. It simplifies setting up a new React Environment with a sensible default configuration, allowing developers to focus on writing code without worrying about build configurations.This article will guide you through the steps to create
    3 min read
    What are Action's creators in React Redux?
    In React Redux, action creators are functions that create and return action objects. An action object is a plain JavaScript object that describes a change that should be made to the application's state. Action creators help organize and centralize the logic for creating these action objects.Action C
    4 min read
    What is the use of React.createElement ?
    React.createElement is a fundamental method of React JS. The main use of React.createElement is the Creation of a React component. It is the JavaScript format for creating react components. Also, the JSX react component when transpired invokes this only method for creating the component. Syntax:Reac
    2 min read
    React 19 : New Features and Updates
    React 19 is officially released on April 25, 2024, marking a significant milestone. This release brings various new features and improvements to enhance developer experience and application performance. Many experimental features in React 18 are now considered stable in React 19, offering a more rob
    15+ min read
    What's new in Next.js 13
    Next.js 13 brings a host of innovative features and improvements, elevating the framework's capabilities and enhancing the development experience. From a cutting-edge build tool to advanced routing and server-side rendering features, Next.js 13 is designed to streamline workflows and boost performan
    5 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences