Generally I want to make Domain mounting more strict so that I can add some optimizations and support new features. For some new features I need isolation between domains. Sharing keys, mounting a domain to the same key as a parent, and root level Domains are problematic for those use cases.
No duplicate domain keys on forks
While I like forks for mounting new state, I think I was wrong to allow them to process data again:
let parent = new Microcosm()
parent.addDomain('planets', {...})
let child = parent.fork
child.addDomain('planets', {...}) // Add new processors on top of whatever the parent gives you
The original idea was to use this for features like pagination and layering on app section specific data to a resource. It turns out that this just makes things complicated and our presenter models are more appropriate for that.
It also causes a lot of internal complexity and extra object clones, and I'd appreciate not having to maintain that.
No duplicate domain keys on the same repo
Additionally, I'd like to make it so that you can only mount one domain per key. Adding more than one domain for the same key has only caused trouble. One alternative would be to allow you to add "subdomains" at specific keys within a root level domain.
No root level domains
I want to get rid of root level domains as a part of this purge as well. They prevent us from doing some neat optimizations and other future ideas for domains:
Generally I want to make Domain mounting more strict so that I can add some optimizations and support new features. For some new features I need isolation between domains. Sharing keys, mounting a domain to the same key as a parent, and root level Domains are problematic for those use cases.
No duplicate domain keys on forks
While I like forks for mounting new state, I think I was wrong to allow them to process data again:
The original idea was to use this for features like pagination and layering on app section specific data to a resource. It turns out that this just makes things complicated and our presenter models are more appropriate for that.
It also causes a lot of internal complexity and extra object clones, and I'd appreciate not having to maintain that.
No duplicate domain keys on the same repo
Additionally, I'd like to make it so that you can only mount one domain per key. Adding more than one domain for the same key has only caused trouble. One alternative would be to allow you to add "subdomains" at specific keys within a root level domain.
No root level domains
I want to get rid of root level domains as a part of this purge as well. They prevent us from doing some neat optimizations and other future ideas for domains: