Open kirkdrichardson opened 5 years ago
@ed42311 what do you think?
@kirkdrichardson, this sounds pretty solid. Need to set some time aside to break some of this process down. This is great context though. Class started, got me like 👊 . The componentization and modularization of data for each lesson makes sense. Have some open source time today I'll take a a quick read in and build out some more comments.
Alright after a bit of looking around, I think I get part of what you are getting at, some of it is just going to be stumbling around a bit.
I'm not sure you ever actually ask a question up there, but the concept makes sense a stripped down JSON object array drops into a module container.
At a minimum, I think we should be able to have a ModuleList component for each of the sidebar topics. This component would fetch (& memoize, prob within a mobx store) the rollup of lessons under that module in a style similar to Khan Academy.
The ModuleList component would return a ModuleListItem[], which would be a lesson card type of UI.
Clicking on a ModuleListItem link would route to .../details/:id which would render a ModuleLesson (or some better name)...
The question is...
Those ModuleLesson components will not have a standard format, though they may share some functionality.
What would be cool is if those ModuleLesson components pulled the id from the router link, and fetched a serialized component from the server. So, each lesson could be custom, but our way of rendering it would be standard. The ModuleLesson would just be a wrapper for its component prop, adding (possibly) a title and making the fetch call. We could probably code split this way too & return a separate bundle from the server, to be deserialized upon receipt in the ModuleLesson DidMount.