RaveJS / rave

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

Where is require() #77

Open CNSKnight opened 9 years ago

CNSKnight commented 9 years ago

Sorry - might be overlooking something in RaveJS doc, but where is/how to reference AMD require() API feature?

unscriptable commented 9 years ago

A require function is injected into the scope of each module, just like normal AMD and CommonJS. I guess I didn't think to document this since it's standard behavior?

CNSKnight commented 9 years ago

Ah - define()'s special dependencies ['require', 'module', 'exports']

@note as curl() ≟≟≟ require() - I could/did use curl() globally?

unscriptable commented 9 years ago

Actually, curl != require. One of AMD's problems that may be fixed in the official loaders is the lack of separation of the import API from the bootstrap API, which is usually a global. These APIs should be separate. Rave takes this to the extreme and eliminates the bootstrap global from user space, entirely.