I'm enjoying JSS so far but have some general questions about what I perceive as "overhead" work involved in setting up the routes, component definitions and such.
If I want to add a component, this is my understanding of what needs to be done:
- Create the component itself.
- Add entries for the component and its fields to a data/routes yaml.
- Create a Sitecore definition file for the component (ComponentName.sitecore.js)
- Import the component to ComponentFactory and set it.
This means:
- We have similar sets of data repeated in the component prop types, the routes yaml, and the definition file.
- Anytime I want to modify a component (say to add a new field), I have to update those three files.
- Initial setup of the routes yamls could be very time consuming, manually filling out multiple pages'/routes' worth of data.
- The main interface for rearranging components and editing their data is a yaml file. Again, this seems potentially time consuming and tedious.
So, I guess my questions are:
- Have I summarized this correctly? Am I over- or understating the amount of overhead?
- Are there existing workflow suggestions to mitigate the overhead? (Code-first sounds like the best workflow to me, but perhaps Sitecore-first would help with this?)
- Are there plans to automate some of this or otherwise reduce the complexity? Perhaps the definitions, for example, could be auto-generated from the yaml and/or component prop types?
And finally, I found this blurb on the JSS documentation site, but don't understand it:
The manifest is generated by taking the YAML or JSON manifest data files described previously and reading them, then adding them to a JavaScript API that generates the manifest. This means that you can replace the JSON or YAML files with direct JS API calls, should you wish to do so. The sample apps use the convention of the /data folder as a convention only - the actual manifest is created using the manifest source files in /sitecore/definitions/*.sitecore.js. These manifest definition files use helper libraries to crawl the YAML/JSON files and add them to the JS manifest object. If you wish to extend or replace the /data convention, that's entirely possible.
So...
- Can you explain the above and whether there are some possibilities here around what I've been asking?
Sorry for the long question, and thanks in advance. I look forward to working with JSS as it evolves.