-
Notifications
You must be signed in to change notification settings - Fork 34
Anatomy of an Obojobo Node or Chunk
Obojobo uses NPM modules to isolate independent chunks so they can easily be added, removed, and replaced to extend and customize ObojoboNext. This project is a monorepo (a git repository that gets published as multiple NPM packages), using yarn workspaces.
The whole idea is you can run yarn add obojobo-chunks-crazyidea
to your server. Run migrations, compile js/css assets, and run.
We have a standard (but evolving) way to make sure modules have a way to register their various features. The files below outline what each of those parts are.
Obojobo module registration. This is the first step in how obojobo finds code in chunks. It allows this package to register it's code to be included in database migrations, express server code, client javascript files, and format conversions. Webpack uses this to find scripts to compile.
Viewer and Editor. Translates both directions between Obojobo JSON and OboModel/Backbone.
Editor only. Translates both directions between Obojobo JSON and Slate JSON. File name is just a convention, referenced from editor-registration.js
Editor only. Registers all the chunk parts needed for the editor. Not able to be renamed, but will be in the future using index.js.
viewer version of editor-registration (needs a rename) Not able to be renamed, but will be in the future using index.js.
Editor only. An empty node in slate JSON format. Used for spawning new instances of this in the editor. File name is just a convention.