This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.
Releases
@happykit/flags@3.0.0
Major Changes
1822587: BREAKING CHANGE: Configuration overhaul
What
This release changes HappyKit's configuration approach.
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.
Why
This release replaces the existing configuration approach with a new one. This new approach configuration prepares happykit for upcoming features.
How
1. Add flags folder
Follow the updated Setup instructions to create the flags folder in your own application, and fill it with.
After this step, you should have
./flags/config.ts which exports a configuration
./flags/client.ts which exports a useFlags function
./flags/server.ts which exports a getFlags function
./flags/edge.ts which exports a getEdgeFlags function
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.
Releases
@happykit/flags@3.0.0
Major Changes
1822587: BREAKING CHANGE: Configuration overhaul
What
This release changes HappyKit's configuration approach.
Previously you had to create a
flags.config.js
file and import it into yourpages/_app.js
and into every middleware that wanted to use feature flags. If you were using your ownAppFlags
type, you also had to pass this type every time you invokedgetFlags()
,useFlags()
orgetEdgeFlags()
. And the configuration options for client-, server- and edge were mixed together into a singleflags.config.js
file.Why
This release replaces the existing configuration approach with a new one. This new approach configuration prepares happykit for upcoming features.
How
1. Add
flags
folderFollow the updated Setup instructions to create the
flags
folder in your own application, and fill it with.After this step, you should have
./flags/config.ts
which exports a configuration./flags/client.ts
which exports auseFlags
function./flags/server.ts
which exports agetFlags
function./flags/edge.ts
which exports agetEdgeFlags
function2. Set up absolute imports
Enable Absolute Imports as described here.
3. Adapt your imports
Then change the application code in your
pages/
folder to use these functions from yourflags/
folder instead of from@happykit/flags
: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.*
4. Delete your old setup
We can now delete the old setup since we no longer need it
flags.config.js
flags.config
import from yourpages/_app
filepages/_app
file if it's not doing anything else anymoreflags.config
from your middlewareexample@0.1.1
Patch Changes