SystemJS 0.20.0
SystemJS 0.20 is a rewrite of SystemJS on top of the 2.0 release of es-module-loader.
It remains as backwards-compatible as possible, while also tracking the changes of direction
that have been happening at the specification level.
There are a number of breaking changes and deprecations as listed below.
To upgrade, first run SystemJS 0.19 with System.config({ warnings: true }) and fix all the deprecation
warnings first before running SystemJS 0.20.
The corresponding release of SystemJS Builder is available at https://github.com/systemjs/builder/releases/tag/0.16.0.
For background on this release, see the blog post at http://guybedford.com/systemjs-alignment.
New Features:
- Improved performance and reduced file size.
- Supports the dynamic import('./module.js') syntax in modules, when
transpiled with the Babel system module format with the babel-plugin-syntax-dynamic-import plugin enabled (alternatively this support is also provided by the SystemJS babel plugin). - Supports automatically loading Web Assembly when enabled via the flag System.config({ wasm: true })
- New small optimized production build (5KB) for just loading System.register modules with baseURL, paths, map, contextual map, bundles, depCache and wasm support.
- Normalization is now fully idempotent
- format: 'system' is supported as an alternative to format: 'register'
Breaking Changes:
- Removes the ability to use named imports from non-ES modules (eg import {readFile} from 'fs' should be import fs from 'fs'; fs.readFile). This is in order to align with the NodeJS ES module directions (https://github.com/nodejs/CTC/pull/60/files#diff-2b572743d67d8a47685ae4bcb9bec651R217).
- Removes support for defaultJSExtensions
- Default transpiler loading is removed. It is no longer possible to transpile sources without configuring one of the transpiler plugins.
- Setting baseURL directly is no longer supported - use System.config({ baseURL: 'x' }) over System.baseURL = x.
- No longer possible to set System.map['x'] = 'asdf'. Must use System.config({ map: { x: 'asdf' } }).
- Hooks no longer exist (just resolve and instantiate as in es-module-loader). Hooks via plugins still work fine.
- Supports IE9+ but scriptLoad support is only included in IE11+
- deps is no longer supported for System.register / System.registerDynamic / script load
- Global exports metadata as an array will no longer export the default as the first global.
- format: 'esm' must now be used instead of format: 'es6'
- A bundle with a single named System.register statement will no longer give an anonymous module value
- No more special handling of trailing slash in CJS
- System.load now does normalization, to match WhatWG spec. This method may well be deprecated as idempotent normalization should make this no longer necessary.
- AMD define no longer set by default when using scriptLoad, requires manually setting window.define = System.amdDefine for scriptLoad support of AMD.
- The separate SystemCSP and register builds are no longer available
- Disables a previous experimental functional return variation of System.register
- Alias feature is removed
- System and SystemJS globals are no longer defined in NodeJS
Bug Fixes
- depCache now uses link preloading instead of partial execution techniques which have been unreliable.