Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit ef5020f

Browse files
Version Packages (#30)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent d9ebb3b commit ef5020f

File tree

5 files changed

+74
-64
lines changed

5 files changed

+74
-64
lines changed

.changeset/slimy-items-dress.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

example/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# example
2+
3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [1822587]
8+
- @happykit/flags@3.0.0

example/package.json

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

package/CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# @happykit/flags
2+
3+
## 3.0.0
4+
5+
### Major Changes
6+
7+
- 1822587: BREAKING CHANGE: Configuration overhaul
8+
9+
### What
10+
11+
This release changes HappyKit's configuration approach.
12+
13+
Previously you had to create a `flags.config.js` file and import it into your `pages/_app.js` and into every middleware that wanted to use feature flags. If you were using your own `AppFlags` type, you also had to pass this type every time you invoked `getFlags()`, `useFlags()` or `getEdgeFlags()`. And the configuration options for client-, server- and edge were mixed together into a single `flags.config.js` file.
14+
15+
### Why
16+
17+
This release replaces the existing configuration approach with a new one. This new approach configuration prepares happykit for upcoming features.
18+
19+
### How
20+
21+
#### 1. Add `flags` folder
22+
23+
Follow the updated [Setup](https://github.com/happykit/flags/tree/master/package#setup) instructions to create the `flags` folder in your own application, and fill it with.
24+
25+
After this step, you should have
26+
27+
- `./flags/config.ts` which exports a configuration
28+
- `./flags/client.ts` which exports a `useFlags` function
29+
- `./flags/server.ts` which exports a `getFlags` function
30+
- `./flags/edge.ts` which exports a `getEdgeFlags` function
31+
32+
#### 2. Set up absolute imports
33+
34+
Enable Absolute Imports as described [here](https://github.com/happykit/flags/tree/master/package#absolute-imports).
35+
36+
#### 3. Adapt your imports
37+
38+
Then change the application code in your `pages/` folder to use these functions from your `flags/` folder instead of from `@happykit/flags`:
39+
40+
```diff
41+
- import { useFlags } from "@happykit/flags/client"
42+
+ import { useFlags } from "flags/client"
43+
```
44+
45+
```diff
46+
- import { getFlags } from "@happykit/flags/server"
47+
+ import { getFlags } from "flags/server"
48+
```
49+
50+
```diff
51+
- import { getEdgeFlags } from "@happykit/flags/edge"
52+
+ import { getEdgeFlags } from "flags/edge"
53+
```
54+
55+
_Note that because of the absolute imports we configured in step 2, all imports from `"flags/_"` will use the local flags folder you created in step 1.\*
56+
57+
#### 4. Delete your old setup
58+
59+
We can now delete the old setup since we no longer need it
60+
61+
- delete `flags.config.js`
62+
- remove the `flags.config` import from your `pages/_app` file
63+
- you might be able to delete the `pages/_app` file if it's not doing anything else anymore
64+
- remove the import of `flags.config` from your middleware

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@happykit/flags",
3-
"version": "2.0.7",
3+
"version": "3.0.0",
44
"description": "Feature Flags for Next.js",
55
"author": "Dominik Ferber <dominik.ferber+npm@gmail.com> (http://dferber.de/)",
66
"license": "MIT",

0 commit comments

Comments
 (0)