1.0.3 • Published 7 years ago

modulin-fetch v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Modulin Fetch

IMPORTANT! This is a work in progress and does not currently follow the ES6 nor the AmdJS specs. Only ment to be used in development environments

Modulin Fetch was created after some rebelling of all the tooling which is required today to setup a minial development environment. Thats is why the project does NOT ship a javascrip parser and does NOT hold an AST (Abstract syntax tree) of the code. It currently supports a large subset of the ES6 import/export statements but is limited by what type of syntax is parsable when using regular expressions and what kind of variable manipulation can be executed safely without having an AST.

A minimal transpiler for ES6 import/export statements is provided using regular expressions which limits it's power but the solution has proven easy to work with. Behind the scenes it transpiles each file into an amd module and loads the module using a bundeled module loader.

A demo of the hello-world.html in action can be found here (Should work in most browsers)

A demo of the hello-css.html in action can be found here (Imports both HTML and CSS through the default import syntax and renders two buttons to the DOM)

A demo of modulin fetch loading it's own source can be found here (Chrome 54+ is recomended since the source consists of non transpiled ES6 code)

Compatibility

Browsers

  • IE9+
  • Chrome 11+
  • Firefox 4+

ES6

  • Named, aliased and glob imports
  • Named, aliased and glob exports
  • Live variables
  • Line breaks in import statements
  • Line breaks in export statements

AmdJS

  • Named modules
  • Non cyclic dependency resolving
  • Cyclic dependency resolving
  • Auto detect filenames

HTML (Experimental)

  • Default export

CSS modules (Experimental)

  • Css selector to javascript hashmap generator
  • Selector composition