beautyjoy / llab

Lightweight lab curriculum system
7 stars 13 forks source link

2017 Loader Re-Write #166

Open cycomachead opened 7 years ago

cycomachead commented 7 years ago

Lunch Time thoughts..

More difficult stuff:

cycomachead commented 6 years ago

That last part is mostly done.

Perhaps we can define a module syntax?

llab.modules = {
   curriculum: {
      dependencies: ['jQuery', 'library'],
      path: 'src/curriculum.js',
      onLoad: function() {},
      ...,
  },
};

This feels like reinventing the wheel. Maybe a build system is still just easier. :/

Then we can have a meta onLoad function that checks if dependencies are ready and if so calls the onLoad for that module. Then if the dependencies aren't ready, it can create callbacks.