RaveJS / rave

Zero-configuration application bootstrap and development
278 stars 8 forks source link

Refactor es5 pipelines to have a dedicated module registry #6

Open unscriptable opened 10 years ago

unscriptable commented 10 years ago

According to this js-loaders issue, we need to manage our own ES5 modules with a separate module registry.

unscriptable commented 10 years ago

The ES6 loader will not support circular dependencies in anything but ES6 modules. The proposed way to handle this is with a separate registry (cache) for ES5 modules (AMD, node), bypassing the ES6 instantiate hook's dependency fetching feature.

There's a silver lining here! Keeping our own registry allows us to avoid having to transform ES5 modules to ES6 and back again when they are passed through the ES6 loader! This improves performance and removes ugly hacks!! Woohoo!

unscriptable commented 10 years ago

Guy Bedford has an alternate proposal that would eliminate the side registry. I'm waiting to see if his proposal gains any traction.