Client side rendering template with ton of features.
It's considered good practice to lock the versions of your environment tools, such as Node.js and pnpm. To do this,
you can specify the required versions in the engines
field in package.json
and configure enforcement using the
.npmrc
file in your project's root.
If needed, you can disable strict version checks by setting engine-strict=false
in .npmrc
.
- clone project
git clone https://github.com/jquery-dlya-slabih/csr.git
- install pnpm 10.x version
npm install -g pnpm@latest-10
- install deps
pnpm install
- run dev
pnpm run dev
- install deps
pnpm install
- pnpm build
description | command |
---|---|
run dev build with dev server | pnpm dev |
run prod build | pnpm build |
run linting | pnpm lint |
run prettier check | pnpm prettier:check |
run prettier write | pnpm prettier:write |
run type checking | pnpm types |
run bundle analyzer | pnpm analyze |
run unit tests | pnpm test |
show unit tests information | pnpm test:ui |
run e2e tests | pnpm e2e |
run e2e tests in ui | pnpm e2e:ui |
show e2e tests information | pnpm e2e:report |
run e2e codegen | pnpm e2e:codegen |
generate assets for pwa | pnpm generate-pwa-assets |
There is a pre-push
hook in the .githooks
folder. If you want to add another hook, for example pre-commit
, then you need:
- create a file with name
pre-commit
in.githooks
folder - in project root use command
chmod +x .githooks/pre-commit
- fill new hook with any commands, like
pre-push
hook
If you want to delete all hooks:
- remove
.githooks
folder - remove
prepare
command inpackage.json
- in project root use command
git config --unset core.hooksPath
- use command
sudo nano /etc/hosts
- add
127.0.0.1 csr-local.com
- save file
- use command
pnpm dev
A DNS reset may be necessary. On macOS, the simplest solution is to restart the system.
For aliasing just add alias in file tsconfig.app.json
.
login | password |
---|---|
avat | avatpass |
emilys | emilyspass |
- Test runner https://vitest.dev/
- Render react components https://testing-library.com/docs/react-testing-library/intro/
- Custom matchers to test the state of the DOM https://github.com/testing-library/jest-dom
- E2E tests https://playwright.dev/
For generating pwa assets:
- add to
public
folder your icon, name of icon must befavicon.svg
- use command
pnpm generate-pwa-assets
If you have any problems with canvas on macOS, use command brew install pkg-config cairo pango libpng jpeg giflib librsvg
.
Tailwind CSS v4.0 is designed for and tested on modern browsers, and the core functionality of the framework specifically depends on these browser versions:
- Chrome 111 (released March 2023)
- Safari 16.4 (released March 2023)
- Firefox 128 (released July 2024)
For this reason, we need to transpile the code to older browsers. List of supported browsers here.
Alternatively, if you only need to support browsers compatible with Tailwind, you can safely remove Lightning CSS.
Since TanStack Router doesn’t work on the server without TanStack Start, static generation isn’t possible. In a separate repository, I demonstrated a concept of how this could be implemented using React Router as an example.
The master branch has an example without code splitting, while the lazy branch demonstrates its usage with code splitting.
Feel free to open an issue or submit PRs.