Entry point names
Right now we have pwa
, amp
and server
. I don’t quite like pwa
anymore. pwa
means other things in 2019.
I will stick to client.js
and server.js
inside pwa
and amp
tho. I think it’s clear. But I think server/index.js
is confusing when compared to pwa/server.js
.
Both pwa
and amp
are dynamic coming from settings “matches”. There’s a default match so maybe it can be default
and amp
but I don’t quite like default
either as it doesn’t mean anything. I think we also need a better name for “matches”.
So right now:
/my-theme-or-extension
/src
/pwa (default?)
client.js
server.js
/amp
client.js
server.js
/server
index.js
@development-team: I’m sure we can do better! any ideas?
Export different namespaces
We want to incorporate multiple namespaces per package. That means we can’t use the export default for React anymore but we don’t need to code split the packages themselves so we are ok.
We need a name. My first thought is root
but I don’t like it very much. Ideas welcomed.
Fills and Slots
We also need to make sure that <Fills />
are included after the <Slots />
or they won’t work.
The easiest way to solve it is to have a separate export for them, like fills
.
@David do you remember which other approaches we discussed about this?
Libraries (effects)
Our old libraries (env
) now go inside the store, in the Overmind effects
.
Let’s work on our exports!
// pwa/client.js
const theme = {
root: Theme, // This is the same than our old default export.
fills: Fills, // This are the fills, separated from the root.
Store: ThemeStore, // This is the Overmind store, just like our old MST store.
};
const router = {
Store: SimpleRouterStore, // Expose the store of the simple-router.
};
// This theme has its own comments package.
const comments = {
components: Components, // Components to be used by other extensions
Store: CommentsStore,
}
// Export namespaces
export default {
theme,
router,
comments,
}