GithubHelp home page GithubHelp logo

oizhaolei / create-react-app-typescript-todo-example-2021 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laststance/react-typescript-todomvc-2022

1.0 2.0 0.0 32.68 MB

๐Ÿš€ Create React App TypeScript Todo Example 2021

Home Page: https://create-react-app-typescript-todo-example.netlify.app

License: MIT License

JavaScript 46.01% HTML 0.90% TypeScript 51.49% CSS 1.43% Shell 0.16%

create-react-app-typescript-todo-example-2021's Introduction

Create React App TypeScript Todo Example 2022

Netlify Status CI Cypress.io check-code-coverage tested with jest code style: prettier All Contributors Depfu This project is using Percy.io for visual regression testing.

gif

A Modern Code Style Todo Example ๐Ÿ“

This project was started with the goal of continuing to publish Todo Example Apps in the latest React writing style.

When React Hooks unveiled in autumn 2018, I was looking for todo apps that written by new style Function Component and Hooks to learn how to use them in real applications but I couldn't find any at that time.

Not only that, many of the results were written in ES5 (using React.createClass() API), which was an older JavaScript generation in autumn 2018. At that time, I thought there is a demand to keep updating and publishing with a modern code style even it is simple example like Todo App.

The project is targeting for who have completed a basic JavaScript programming course and new to React, peaople who migrating to React from another JavaScript Framework, and you have used to React in the past and want to catch up on the modern way for write back again.

I'm glad to even the repo could be useful for your learning. ๐Ÿค— ใ€€
ใ€€

Edit create-react-app-typescript-todo-example-2022


Getting Started

  • The app assumed installed Node.js newer than 10.16.3 LTS(recommend newer than v14.8.0). If you have not it yet, follow the official Node.js Doc to install it.
npx degit laststance/create-react-app-typescript-todo-example-2022 create-react-app-typescript-todo-example-2022
cd create-react-app-typescript-todo-example-2022
yarn install
yarn start

after that auto launch todo app on your default browser and code edit ready.


Stack

๐Ÿ‘ฉโ€๐Ÿ’ป Usage

yarn start

After that you'll seen the console which are server processes messages.
Let's follow the message and put in URL http://localhost:3000/ your browsers adressbar,
and then you'll got todo app as same as Demo. let's modify under the src/ code feel free!!

Official Docs: https://create-react-app.dev/docs/getting-started#npm-start-or-yarn-start

yarn build

After that You'll get bundled and optimization stuff in build directory.
Also you can run production build with serve local webserver modules.

yarn global add serve
serve -s build

Official Docs: https://create-react-app.dev/docs/getting-started#npm-run-build-or-yarn-build

yarn lint

ESLint is at the top. And setup TypeScript ESLint, integrating Prettier as a eslint-plugin-prettier.

yarn lint:fix

run wtih eslint --fix option.

yarn typecheck

While developing and building, Babel stop transpile with TS error messages. I can't find way static typecheck with babel, so I'm using original TypeScript via npm and specified tsc --noEmit compile option that doesn't generate compiled code.

yarn test

Jest is all-in-one test-runner built in Create React App and covers function-level unit testing to component-behavior-level integration testing. The Repo use to react-testing-library for component integration testing.

yarn cypress:open

Cypress is all-in-one E2E Testing tool which can deal testing on real browser.
This command using Electron by Cypress default.

yarn cypress:open require yarn start before.

yarn start # Launch DevServer
yarn cypress:open

cypress_open

yarn cypress:run

Run Cypress with Electron.
That's same as run all test on cypress GUI after run yarn cypress:open.

yarn start # Launch DevServer
yarn cypress:run

yarn cypress:run:headless

Run Cypress with headless Electron.
That mean this command complete all on a terminal without GUI.

yarn start # Launch DevServer
yarn cypress:run:headless

๐Ÿ—’ Note

This is not a Best Practice introduction.
There are tons of effective way to create solid software in JavaScript World, you have a lot of other option based on your preference for approaching where, The Repo is just a style of my favorite.

"How to combining TypeScript with massive Babel or JavaScript tools ecosystem?"

I hope this helps you know like that from what I've Published!

Issues

Please feel free to post New Issue or Pull Request ๐Ÿค—

Questions

Please feel free to post New Issue or reply on Twitter ๐Ÿฆ

If you want to get more generally answers, these community are might be helpful ๐Ÿป

LICENSE

MIT

Contributors

Thanks goes to these wonderful people (emoji key):


ryota-murakami

๐Ÿ’ป ๐Ÿ“– โš ๏ธ

Will Roscoe

๐Ÿ’ป

Peng Fei

๐Ÿ›

Alex Panchuk

๐Ÿ“–

Burhan Mullamitha

๐Ÿ“–

hefengxian

๐Ÿ’ป โš ๏ธ

Ethan Setnik

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

create-react-app-typescript-todo-example-2021's People

Contributors

alexpanchuk avatar allcontributors[bot] avatar burhanmullamitha avatar dependabot[bot] avatar depfu[bot] avatar esetnik avatar hefengxian avatar oizhaolei avatar ryota-murakami avatar wroscoe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.