Use System.get instead of System.import

Means we get drop Promise polyfill
This commit is contained in:
Toby Zerner 2015-07-27 14:16:39 +09:30
parent de610eac35
commit d82da543b4
3 changed files with 15 additions and 20 deletions

View File

@ -9,7 +9,6 @@
"color-thief": "v2.0",
"mithril": "lhorie/mithril.js#next",
"es6-micro-loader": "caridy/es6-micro-loader#v0.2.1",
"es6-promise-polyfill": "~1.0.0",
"fastclick": "~1.0.6"
}
}

View File

@ -7,7 +7,6 @@ gulp({
files: [
nodeDir + '/babel-core/external-helpers.js',
bowerDir + '/es6-promise-polyfill/promise.js',
bowerDir + '/es6-micro-loader/dist/system-polyfill.js',
bowerDir + '/mithril/mithril.js',

View File

@ -26,26 +26,23 @@
@endforeach
<script>
var app;
System.import('flarum/app').then(function(module) {
try {
app = module.default;
app.preload = {
data: {!! json_encode($data) !!},
document: {!! json_encode($document) !!},
session: {!! json_encode($session) !!}
};
try {
var app = System.get('flarum/app').default;
app.preload = {
data: {!! json_encode($data) !!},
document: {!! json_encode($document) !!},
session: {!! json_encode($session) !!}
};
@foreach ($bootstrappers as $bootstrapper)
System.import('{{ $bootstrapper }}');
@endforeach
@foreach ($bootstrappers as $bootstrapper)
System.import('{{ $bootstrapper }}');
@endforeach
app.boot();
} catch (e) {
document.write('<div class="container">Something went wrong.</div>');
throw e;
}
});
app.boot();
} catch (e) {
document.write('<div class="container">Something went wrong.</div>');
throw e;
}
</script>
@if ($content)