in ,

facebook / create-react-app, Hacker News

facebook / create-react-app, Hacker News


    

3.3.0 (2019 – 12 – 04)

v3.3.0 is a minor release that adds new features, including custom templates and support for the new optional chaining and nullish coalescing operators.

Custom Templates

You can now create a new app using custom templates.

We’ve published our existing templates ascra-templateandcra-template-typescript, but we expect to see many great templates from the community over the coming weeks.

The below command shows how you can create a new app withcra-template-typescript.

npx create-react-app my-app --template typescript

Note that you can omit the prefixcra-template -when specifying which template you would like. For TypeScript users, we’re deprecating- typescriptin favor of- template typescript.

If you don’t set a template, we’ll create your new app withcra-template– which is just a new name for our base template.

Optional Chaining and Nullish Coalescing Operators

We now support theoptional chainingandnullish coalescingoperators!

//Optional chaininga?. ();//undefined if `a` is null / undefinedB?.c;//undefined if `b` is null / undefined//Nullish coalescingundefined??'some other default';//result: 'some other default'null??'some other default';//result: 'some other default'''''??'some other default';//result: ''0??300;//result: 0false??true;//result: false

If your’re using TypeScript, you will need to upgrade yourtypescriptdependency to3.7.0or later if you wish to use the new operators.

If you’re using Visual Studio Code 1. 40 (the latest as of this release) or earlier, you will need to configure your editor if you want it to understand the new operators.

If you’re using TypeScript in your project and have already upgrade its version as described above, then you canconfigure VS Code toUse Workspace Versionof TypeScript. If your project isn’t using TypeScript, you can use theJavaScript and TypeScript Nightly extensionuntil VS Code releases a newer version including TypeScript3.7.0or newer.

Numeric Separators

We’ve added support fornumeric separatorsto improve readability of numeric literals.

1000000000;//Is this a billion? a hundred millions? Ten millions?101475938. 38;//what scale is this? what power of 10?1 _ 000 _ 000 _ 000;//Ah, so a billion101 _ 475 _ 938.38;//And this is hundreds of millions

No *** unexpected-multiline

We’ve removed this rule as it is not compatible with Prettier. If you rely on this rule you can re-enable it byextending our ESLint configand adding the following:

{   "extends":"react-app",   "rules": {     "no-unexpected-multiline":"warn"  } }

(🚀) **************************** (New Feature)

  • babel-preset-react-app
  • babel-preset-react- app,react-dev-utils
  • cra-template-typescript,cra-template,create-react-app,react-scripts

💥Breaking Change

  • create-react-app,react-dev- utils,react-scripts

    • # 7988Bump webpack-dev-server (@ ianschmitz)

      NOTE: This is only a breaking change if you’re usingreact-dev-utilsoutside of Create React App.

🐛Bug Fix

💅Enhancement

  • cra-template-typescript,cra-template
  • react-scripts
  • cra-template
  • create-react-app,react-error-overlay
  • babel-preset-react- app
    • # 7726Add babel runtime version to transform-runtime plugin to reduce bundle size (@ topaxi)

(📝) **************************** (Documentation)

***Internal

  • react-scripts
  • Other
  • eslint-config-react- app
    • # 8003Use @ typescript-eslint / no-unused-expressions to support optional chaining (@ maxdavidson)
  • create-react-app
    • (#) added e2e test for checking typescript template with unsupported node (@ awaseem)
    • # 7882refactor: remove double coerce (@ mrmckeb)
    • # 7880Pass through fully specified template name (@ iansu))
  • cra-template-typescript
    • (#) (Make base and TypeScript templates consistent) @ suprj)
  • create-react-app,react-dev-utils,react-scripts

🔨Underlying Tools

Committers: 42

Migrating from 3.2.0 to 3.3.0

Inside any created project that has not been ejected, run:

npm install --save --save-exact [email protected]

or

yarn add --exact [email protected]

  

Brave Browser
Read More
Payeer

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

The Logic of Information: A Theory of Philosophy as Conceptual Design // Notre Dame Philosophical Reviews // University of Notre Dame, Hacker News

Eating patterns more important than insulin for controlling blood sugar – tips for diet management – Times Now, Timesnownews.com

Eating patterns more important than insulin for controlling blood sugar – tips for diet management – Times Now, Timesnownews.com