Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jehoshua02/9204698 to your computer and use it in GitHub Desktop.
Save jehoshua02/9204698 to your computer and use it in GitHub Desktop.
A short list of requirements for a front-end resource loading system.

Requirements for Front-End Resource Loaders

  • Explicit dependencies: I want to know a) what dependencies a any piece of code requires, and b) that that code will not execute until all dependencies are successfully loaded, so that I can have confidence that dependencies are isolated to each piece of code and not being clobbered somewhere, that code is not executing without required dependencies, and that broken dependencies will be obvious so that I can fix them easily.
  • Dependency Manager: I want to lock onto specific versions of dependencies so that I don't have to worry about my application breaking when a new version comes out. I also want to be able to install different versions of a dependency easily so that I can test and make changes to migrate. Oh, and I don't want to have to worry about dependencies of a dependency. That should be handled by dependency manager. I only care about the direct dependency to my application or library. Also, two dependencies can be dependent on different versions of the same dependency and still work just fine.
  • Resource Loading: I don't want just a javascript loader. I want a resource loader. A javascript library may have a css dependency. With modern client-side frameworks we need a way to easily load templates without requiring server side knowledge. I don't want some complicated build process requiring half a dozen or more tools to just get see the result of a simple change.
  • Compile Process: I want to be able to compile everything down for deployment and not have to change anything in my markup or configuration. During development, I want to be able to see results without compiling. I also want to be able to trace back to source files when debugging.
  • Simple: Everything, from installing or updating dependencies, to referencing dependencies in code, should be simple, or I might just give up and go back to the old way of doing things.

Maybe I'm talking about two different things here: Dependencies and Loading. Sounds like Composer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment