Awesome
Project Status from the Author (@ryota-murakami, Aug 16 2023):
I'm considering continue update as a Client Side SPA or Rewrite this app with Server Components.
But Server Components doen't meant obsolete Client Side SPA, both archtecture is great option depends on application type,
dev team type, each dev's skillset type.
Might be keep update both archtecture TODO is ideal vision for me unless there are planty rest time.
Anyway, I thnik was TODO MVC outdated for current JS frameworks.
I want to renew this project about this winter.
React TypeScript TodoMVC 2022
<a href="https://react-typescript-todomvc.netlify.app/"><img src="https://raw.githubusercontent.com/laststance/react-typescript-todomvc-2022/master/images/cypress_open.gif" alt="gif"></a>
A Modern Code Style Todo Example 📝
This project was started with the goal of continue to publish TodoMVC Apps in the latest React writing style.
When you found React.js on TodoMVC top page, you might seen classic style React.createClass()
based source at first.
I don't complain about it because the old-style codebase React app works all over the world and helps peopleAlmost cases, there is no value that spending time for rerwite new syntax sugar of huge codebase.
This project aims to assist new React learners and those who have not written React for a long time by providing a handy resource for learning the latest React.js. I'm glad to even the repo could be useful for your learning. 🤗
Getting Started
- The app assumes that you have installed
Node.js
newer than v18.16.1 LTS. If you don't have it yet, follow the official Node.js Doc to install it.
npx degit laststance/react-typescript-todomvc-2022 react-typescript-todomvc-2022
cd react-typescript-todomvc-2022
npm -g pnpm
pnpm i
pnpm start
after that auto launch todo app on your default browser and code edit ready.
Stack
- TODO-CSS-Template (Borrowing HTML & CSS Thanks! 👍 )
- Vite
- TypeScript v4.2.4
- React Router
- Styled-Components: CSS-in-JS
- Recoil: A state management library for React
- Cypress: E2E Testing
- react-testing-library
- ESLint
- Netlify: Deploy & Hosting
- Github Actions: Automation run tests, lint, typecheck, build
- Depfu: Keep latest npm packages automaticaly
Command
You can do exact same command with npm, or install yarn easily if you have interest.
yarn
or yarn install
Install all Node Package Modules that depending this project.
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!!
yarn build
Production build that bundled optimization stuff in build
directory.
yarn serve
Run production build that generated by yarn build
.
yarn lint
ESLint is at the top.
And setup TypeScript ESLint, integrating Prettier as a eslint-plugin-prettier.
Here is final config list.
yarn lint:fix
Run wtih eslint --fix option.
Actually frequently use for perform Prettier formatting.
yarn typecheck
Check TypeScript error whole porject.
yarn test
Run Jest.
Using react-testing-library for component integration testing.
yarn clean
Delete node_modules/*
, yarn.lock
, build/*
once.
yarn prettier
Run prettier formatting holeproject without all JS/TS files.
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
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):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tbody> <tr> <td align="center" valign="top" width="14.28%"><a href="http://ryota-murakami.github.io/"><img src="https://avatars1.githubusercontent.com/u/5501268?s=400&u=7bf6b1580b95930980af2588ef0057f3e9ec1ff8&v=4?s=100" width="100px;" alt="ryota-murakami"/><br /><sub><b>ryota-murakami</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=ryota-murakami" title="Code">💻</a> <a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=ryota-murakami" title="Documentation">📖</a> <a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=ryota-murakami" title="Tests">⚠️</a></td> <td align="center" valign="top" width="14.28%"><a href="http://donkeycar.com"><img src="https://avatars2.githubusercontent.com/u/147582?v=4?s=100" width="100px;" alt="Will Roscoe"/><br /><sub><b>Will Roscoe</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=wroscoe" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/JunQu"><img src="https://avatars2.githubusercontent.com/u/39846309?v=4?s=100" width="100px;" alt="Peng Fei"/><br /><sub><b>Peng Fei</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/issues?q=author%3AJunQu" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/alexpanchuk"><img src="https://avatars3.githubusercontent.com/u/26270612?v=4?s=100" width="100px;" alt="Alex Panchuk"/><br /><sub><b>Alex Panchuk</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=alexpanchuk" title="Documentation">📖</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/BurhanMullamitha"><img src="https://avatars1.githubusercontent.com/u/42492054?v=4?s=100" width="100px;" alt="Burhan Mullamitha"/><br /><sub><b>Burhan Mullamitha</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=BurhanMullamitha" title="Documentation">📖</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/hefengxian"><img src="https://avatars.githubusercontent.com/u/4338497?v=4?s=100" width="100px;" alt="hefengxian"/><br /><sub><b>hefengxian</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=hefengxian" title="Code">💻</a> <a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=hefengxian" title="Tests">⚠️</a></td> <td align="center" valign="top" width="14.28%"><a href="http://ethansetnik.com"><img src="https://avatars.githubusercontent.com/u/664434?v=4?s=100" width="100px;" alt="Ethan Setnik"/><br /><sub><b>Ethan Setnik</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=esetnik" title="Documentation">📖</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/PaoloJN"><img src="https://avatars.githubusercontent.com/u/87121008?v=4?s=100" width="100px;" alt="Paolo Nessim"/><br /><sub><b>Paolo Nessim</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=PaoloJN" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/likui628"><img src="https://avatars.githubusercontent.com/u/90845831?v=4?s=100" width="100px;" alt="Li Kui"/><br /><sub><b>Li Kui</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=likui628" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://adarshgupta.live/"><img src="https://avatars.githubusercontent.com/u/73733229?v=4?s=100" width="100px;" alt="Adarsh Gupta"/><br /><sub><b>Adarsh Gupta</b></sub></a><br /><a href="https://github.com/laststance/react-typescript-todomvc-2022/commits?author=adarsh-gupta101" title="Documentation">📖</a></td> </tr> </tbody> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->This project follows the all-contributors specification. Contributions of any kind welcome!