Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

0.17 wip #346

Merged
merged 30 commits into from
May 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3df5de2
minimal loader build, first attempt
guybedford Mar 31, 2015
13192fc
separate out url, remove promises
guybedford Apr 3, 2015
d1d6300
note about 1.0
guybedford Apr 3, 2015
18b7ae3
remove js extension adding, simplify System
guybedford Apr 3, 2015
05e314b
eval consolidation
guybedford Apr 3, 2015
c4a5e24
URLUtils -> URL polyfill
guybedford Apr 3, 2015
db5c1eb
use exact environment baseURL
guybedford Apr 3, 2015
1e6e9c0
global build public/private scoping
guybedford Apr 3, 2015
1889e51
System.import use direct parentName argument
guybedford Apr 4, 2015
ecf751a
error handling corrections, constructor adjustments, dynamic-only fix
guybedford Apr 4, 2015
c81ab05
only load when in Node when needed
guybedford Apr 4, 2015
7f77b6a
baseURL sanitize fix, addToError avoid mutation, set System.constructor
guybedford Apr 4, 2015
d2b1896
Test coverage for `System.paths` priorities
crisptrutski Apr 7, 2015
53ef57a
Better path selection in .locate
crisptrutski Apr 7, 2015
d053253
Fix error reporting bug
crisptrutski Apr 8, 2015
8c807f5
dynamic only fix, url polyfill fix
guybedford Apr 12, 2015
66e0743
rename transpiling build to dev
guybedford Apr 12, 2015
c3eb46d
support pluginLoader for transpiler
guybedford Apr 14, 2015
4750764
regex fix
guybedford Apr 17, 2015
0386a92
remove Babel jsx blacklist entirely
guybedford Apr 18, 2015
64a03e3
ios7 webworker changes port, url polyfill not a global
guybedford Apr 29, 2015
837210c
remove WorkerGlobalScope
guybedford Apr 29, 2015
5ecb98f
new normalization spec algorithm
guybedford May 5, 2015
189c2c9
temporarily disable test
guybedford May 5, 2015
ac944e2
fix node tests
guybedford May 5, 2015
564f507
remove manual tests
guybedford May 6, 2015
58c50ea
separate fetch implementation
guybedford May 6, 2015
a0ee0f4
Windows Node paths fix
guybedford May 11, 2015
80c2119
polyfill handling
guybedford May 15, 2015
6524a6d
make baseURL a loader constructor option
guybedford May 16, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
71 changes: 27 additions & 44 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,30 @@ module.exports = function (grunt) {
dist: {
files: {
'dist/<%= pkg.name %>.src.js': [
'node_modules/when/es6-shim/Promise.js',
'src/polyfill-wrapper-start.js',
'dist/<%= pkg.name %>.js',
'src/polyfill-wrapper-end.js'
'src/wrapper-start.js',
'src/loader.js',
'src/dynamic-only.js',
'src/url-polyfill.js',
'src/system.js',
'src/system-resolve.js',
'src/system-fetch.js',
'src/wrapper-end.js'
],
'dist/<%= pkg.name %>-sans-promises.src.js': [
'src/polyfill-wrapper-start.js',
'dist/<%= pkg.name %>.js',
'src/polyfill-wrapper-end.js'
'dist/<%= pkg.name %>-dev.src.js': [
'src/wrapper-start.js',
'src/loader.js',
'src/declarative.js',
'src/transpiler.js',
'src/url-polyfill.js',
'src/system.js',
'src/system-resolve.js',
'src/system-fetch.js',
'src/module-tag.js',
'src/wrapper-end.js'
]
}
}
},
esnext: {
dist: {
src: [
'src/loader.js',
'src/transpiler.js',
'src/system.js'
],
dest: 'dist/<%= pkg.name %>.js'
}
},
'string-replace': {
dist: {
files: {
'dist/<%= pkg.name %>.js': 'dist/<%= pkg.name %>.js'
},
options: {
replacements:[{
pattern: 'var $__Object$getPrototypeOf = Object.getPrototypeOf;\n' +
'var $__Object$defineProperty = Object.defineProperty;\n' +
'var $__Object$create = Object.create;',
replacement: ''
}, {
pattern: '$__Object$getPrototypeOf(SystemLoader.prototype).constructor',
replacement: '$__super'
}]
}
}
},
uglify: {
options: {
banner: '<%= meta.banner %>\n',
Expand All @@ -77,21 +60,21 @@ module.exports = function (grunt) {
src: 'dist/<%= pkg.name %>.src.js',
dest: 'dist/<%= pkg.name %>.js'
},
distSansPromises: {
src: 'dist/<%= pkg.name %>-sans-promises.src.js',
dest: 'dist/<%= pkg.name %>-sans-promises.js'
devDist: {
options: {
banner: '<%= meta.banner %>\n'
},
src: 'dist/<%= pkg.name %>-dev.src.js',
dest: 'dist/<%= pkg.name %>-dev.js'
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-esnext');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-string-replace');

grunt.registerTask('lint', ['jshint']);
grunt.registerTask('compile', ['esnext', 'string-replace', 'concat']);
grunt.registerTask('default', [/*'jshint', */'esnext', 'string-replace',
'concat', 'uglify']);
grunt.registerTask('compile', ['concat']);
grunt.registerTask('default', [/*'jshint', */'concat', 'uglify']);
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _For upgrading to ES6 Module Loader 0.16, [read the release notes here](https://

Dynamically loads ES6 modules in browsers and [NodeJS](#nodejs-use) with support for loading existing and custom module formats through loader hooks.

This project implements dynamic module loading through `System` exactly to the previous ES6-specified loader API at [2014-08-24 ES6 Specification Draft Rev 27, Section 15](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27) and is being converted to track the newly redrafted specification at https://github.com/whatwg/loader (work in progress at https://github.com/ModuleLoader/es6-module-loader/tree/1.0).
This project implements dynamic module loading through `System` exactly to the previous ES6-specified loader API at [2014-08-24 ES6 Specification Draft Rev 27, Section 15](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27). The new loader implementing the [WhatWG loader spec](https://github.com/whatwg/loader) is pending alpha release on the [1.0 branch](https://github.com/ModuleLoader/es6-module-loader/tree/1.0).

* Provides an asynchronous loader (`System.import`) to [dynamically load ES6 modules](#getting-started).
* Supports both [Traceur](https://github.com/google/traceur-compiler) and [Babel](http://babeljs.io/) for compiling ES6 modules and syntax into ES5 in the browser with source map support.
Expand Down
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
var System = require('./dist/es6-module-loader.src');
if (typeof Promise === 'undefined')
require('when/es6-shim/Promise');

var System = require('./dist/es6-module-loader-dev.src');

var filePrefix = 'file:' + (process.platform.match(/^win/) ? '/' : '') + '//';

System.transpiler = 'traceur';
try {
System.paths.traceur = 'file:' + require.resolve('traceur/bin/traceur.js');
System.paths.traceur = filePrefix + require.resolve('traceur/bin/traceur.js');
}
catch(e) {}
try {
System.paths.babel = 'file:' + require.resolve('babel-core/browser.js');
System.paths.babel = filePrefix + require.resolve('babel-core/browser.js');
}
catch(e) {}
try {
System.paths.babel = System.paths.babel || 'file:' + require.resolve('babel/browser.js');
System.paths.babel = System.paths.babel || filePrefix + require.resolve('babel/browser.js');
}
catch(e) {}

Expand Down
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ module.exports = function(config) {

[!options.ie8 ? (!options['babel'] ? 'node_modules/traceur/bin/traceur.js' : 'node_modules/babel-core/browser.js') : ''],

'dist/es6-module-loader' + (options.polyfill ? '' : '-sans-promises') + '.src.js',
[options.polyfill ? 'node_modules/when/es6-shim/Promise' : ''],
'dist/es6-module-loader-dev.src.js',

'test/_browser.js',
'test/browser-script-type-module.js',
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-jshint": "~0.6.0",
"grunt-contrib-uglify": "~0.6.0",
"grunt-esnext": "0.0.3",
"grunt-string-replace": "^0.2.7",
"karma": "^0.12.28",
"karma-benchmark": "^0.4.0",
"karma-benchmark-reporter": "^0.1.1",
Expand Down
Loading