Skip to content

Commit 069aa2a

Browse files
committed
Changeset
1 parent ce7f2c0 commit 069aa2a

File tree

8 files changed

+60
-8
lines changed

8 files changed

+60
-8
lines changed

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,43 @@ This project is inspired by `next-themes`. `next-themes` is an awesome package,
2525
- ✅ Doccumented with [Typedoc](https://react18-tools.github.io/react18-themes) ([Docs](https://react18-tools.github.io/react18-themes))
2626
- ✅ Use combinations of [data-th=""] and [data-color-scheme=""] for dark/light varients of themes
2727
- ✅ Use [data-csp=""] to style based on colorSchemePreference.
28+
- ✅ Starting from version 2.3, `localStorage` is used as default storage. **No** `cookies` by default. Use storage="cookies" for smooth initial rendering of server components.
2829

2930
Check out the [live example](https://react18-themes.vercel.app/).
3031

3132
## Install
3233

3334
```bash
3435
$ pnpm add react18-themes
35-
# or
36+
```
37+
38+
**or**
39+
40+
```bash
3641
$ npm install react18-themes
37-
# or
42+
```
43+
44+
**or**
45+
46+
```bash
3847
$ yarn add react18-themes
3948
```
4049

4150
## Want Lite Version? [![npm bundle size](https://img.shields.io/bundlephobia/minzip/react18-themes-lite)](https://www.npmjs.com/package/react18-themes-lite) [![Version](https://img.shields.io/npm/v/react18-themes-lite.svg?colorB=green)](https://www.npmjs.com/package/react18-themes-lite) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/dt/react18-themes-lite.svg)](https://www.npmjs.com/package/react18-themes-lite)
4251

4352
```bash
4453
$ pnpm add react18-themes-lite
45-
# or
54+
```
55+
56+
**or**
57+
58+
```bash
4659
$ npm install react18-themes-lite
47-
# or
60+
```
61+
62+
**or**
63+
64+
```bash
4865
$ yarn add react18-themes-lite
4966
```
5067

@@ -217,6 +234,10 @@ In a similar way, you can also force color scheme.
217234

218235
Forcing color scheme will apply your defaultDark or defaultLight theme, configurable via hooks.
219236

237+
## Changelog
238+
239+
Find changelog here [CHANGELOG.md](lib/react18-themes/CHANGELOG.md)
240+
220241
## Migrating from v1 to v2
221242

222243
#### Motivation:
@@ -226,7 +247,8 @@ For server side syncing, we need to use cookies and headers. This means that thi
226247
Take care of the following while migrating to `v2`.
227248

228249
- No changes required for projects not using `Next.js` app router or server components other than updating cookies policy if needed.
229-
- The persistent storage is realized with `cookies` in place of `localStorage`. (You might want to update cookies policy accordingly.)
250+
- ~~The persistent storage is realized with `cookies` in place of `localStorage`. (You might want to update cookies policy accordingly.)~~
251+
- Starting from version 2.3, persistent storage is again set to `localStorage`. You can change it to `cookies` or `sassionStorage` by passing `storage` prop to `<ThemeSwitcher />` component.
230252
- We have provided `NextJsSSGThemeSwitcher` in addition to `ServerSideWrapper` for `Next.js`. You no longer need to use a wrapper component which broke static generation and forced SSR.
231253
- Visit [With Next.js `app` router (Server Components)](#with-nextjs-app-router-server-components)
232254

examples/nextjs/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# nextjs-example
22

3+
## 0.0.13
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
9+
10+
311
## 0.0.12
412

513
### Patch Changes

examples/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-example",
3-
"version": "0.0.12",
3+
"version": "0.0.13",
44
"private": true,
55
"scripts": {
66
"dev": "next dev --port 3002",

examples/remix/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
### Patch Changes
66

7+
- Updated dependencies
8+
9+
10+
11+
## null
12+
13+
### Patch Changes
14+
715
- Updated dependencies
816
917

examples/vite/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# vite-example
22

3+
## 0.0.13
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
9+
10+
311
## 0.0.12
412

513
### Patch Changes

examples/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vite-example",
33
"private": true,
4-
"version": "0.0.12",
4+
"version": "0.0.13",
55
"type": "module",
66
"scripts": {
77
"dev": "vite --port 3001",

lib/react18-themes/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# react18-themes
22

3+
## 2.3.0
4+
5+
### Minor Changes
6+
7+
- Add storage prop - No cookies by default!
8+
39
## 2.2.0
410

511
### Minor Changes

lib/react18-themes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react18-themes",
33
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
44
"private": false,
5-
"version": "2.2.0",
5+
"version": "2.3.0",
66
"description": "Unleash the Power of React Server Components! Use multiple themes on your site with confidence, without losing any advantages of React Server Components.",
77
"main": "./index.ts",
88
"types": "./index.ts",

0 commit comments

Comments
 (0)