Kea 1.0
See original GitHub issueHi all,
I’ve been rewriting Kea in order to reach the big 1.0
milestone for several days now. I’m nearly there. However before releasing anything, I’d like to ask the community for help with testing and ironing out any edge cases that might show up.
So please, if you’re using kea in your app, read the “How to test?” section below, try it out and report any issues you may experience.
So what changed?
Check out the long list of changes here:
https://github.com/keajs/kea/blob/master/docs/CHANGES-1.0.md
Updated 2019/06/13 with changes for 1.0.0-beta.31
Updated 2019/04/28 with changes for 1.0.0-beta.15
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:15 (9 by maintainers)
Top Results From Across the Web
1. Introduction — Kea 2.0.0 documentation - Read the Docs
Introduction¶. Kea is the next generation of DHCP software, developed by Internet Systems Consortium (ISC). It supports both the DHCPv4 and DHCPv6 protocols ......
Read more >Kea 1.0 is released! Kea is... - Internet Systems Consortium | Facebook
Kea 1.0 is released! Kea is a modern DHCPv4 and DHCPv6 server. It was designed from the start for IPv6. We have built...
Read more >Kea-1.0.0-beta · Tags · ISC Open Source Projects / Kea - GitLab
Welcome to the public repository for the Kea DHCP server.
Read more >kea@1.0.0-beta.31 - Snyk Vulnerability Database
Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities (in both your packages & their dependencies) and provides ...
Read more >Kea 1.0 released: Data Layer for React. Powered by Redux.
I've been using Kea 1.0 in a production webapp with over 300 logics for a while now and I must say that it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi everyone,
As of
beta.31
we now support basic hooks!It’s still a work in progress and there are some gotchas, but it’s getting there.
I put up a long doc with all the 1.0 changes here: https://github.com/keajs/kea/blob/master/docs/CHANGES-1.0.md
Hi @etiennecl , thank you for the continued work on this. I indeed made some big changes regarding context in the latest beta (v20). Previously kea had an “internal context” called a cache, which was set when your bundle loaded and reset when forced to via
resetKeaCache
. This worked fine in the browser, when the cache was always empty on each page load and never reset, but it caused issues with SSR and frameworks like next.js.With the changes in beta.20, this cache is now explicitly called a context and there are tools to mainpulate it. (Functions like
getContext
,setContext
,resetContext
,withContext
, etc). I will write better documentation about it as soon as I can.However until then, you should run
resetContext()
before any call tokea
is made if you wish to configure defaults, plugins, etc. You should no longer pass plugins to the store. Instead pass them to the context.Another big change is that previously we would store all the data inside logic stores (
const logic = kea({})
). Now logic stores are just a collection of functions that delegate to the context. So theoretically if you swap out the context, everything else should still work.Yet another big change is that the lifecycle of kea logic is also more clearly defined. A logic can be in any of these 3 states: 1) initialized, 2) built, 3) mounted.
initialized: Now when you call
kea({})
the logic store is just initialized and added to the context (tocontext.inputs
). Nothing will be automatically built not mounted.built: This refers to converting the kea input (
kea(input)
) into a logic (object with keysactions
,reducers
,selectors
, etc). Previously this happened automatically in step 1, but now it’s deferred as late as possible.mounted:. A logic is mounted if it is connected to redux. This is also when all the sagas and other side effects run and do what they need to do. This happens automatically when you wrap a logic around a React component. If a component is not built when you try to mount it, it will be built automatically.
Before 1.0 all kea logics (at least the ones without a
key
) were automatically mounted when they were initialized. This is no longer the case. If you wish to revert to the pre-1.0 behaviour, runresetContext({ autoMount: true })
before any calls tokea()
are made.(NB!
kea({ options:{lazy: true} })
no longer works. It’s all configured from the context now. I need to update the docs…)Like I said, logics are automatically mounted when you wrap them around react components. However if you need to mount them manually, it’s also possible:
Mounting like this should also start the sagas.
For next.js and the getIinitialProps, I still need to experiment with it and see how it could all work. The building blocks are all there, just I need to make sure they fit well. I’ll get to it in the next days. It’s possible the next redux wrapper needs to be opened up and adjusted to make it all work.
I’ll share more news when I have any. Cheers!