-
Notifications
You must be signed in to change notification settings - Fork 30
Description
[RFC] - Accommodating code for apps rendering inside dotcom-rendering/
🎉 The DC-A-R project is starting! DCR will render articles for an additional platform: the mobile apps. This is in addition to the existing platforms, amp and web.
To accommodate this new platform, we need somewhere to put code specific to rendering for apps. We might also need to move code which is shared between platforms, especially as it's likely we will be able to use many of DCR's web components for apps as well.
Before thinking about where to put new code or move existing code to, there are some questions to consider (and possibly more not listed here!):
- How can we make sure the DCAR project does not make the DCR repository much harder to navigate or work with?
- How can we make it hard to forget that some changes affect multiple platforms, e.g web and apps?
- How can we create a structure which allows us to leverage DCR's capabilities when developing for apps?
A starting point for discussion
In the "apps rendering in DCR" spike, we created an app sdirectory to sit alongside web/ and amp/:
src/
apps/
web/
amp/
...
This helped keep app-specific code separate, but led to apps layouts importing a lot from web's components. This coupling wasn't very clear when working from the web/ directory, but it didn't create any significant problems during the spike.
The main idea of this starting point: create an apps/ directory for apps-specific code and an editions/ directory, and move things which are shared by multiple platforms into a src/common/ directory. This could give a structure that looks something like:
src/
common/
components/
client/
lib/
server/
...
amp/
components/
lib/
pages/
...
apps/
client/
components/
layouts/
lib/
server/
...
editions/
client/
components/
...
web/
client/
components/
...
This is just a starting point for discussion. I'm curious to hear any thoughts, alternatives or concerns!
Additional questions
- How do we want things to look in Storybook?
- Alternatively, could we rename
web/to something, and nestapp/in there?