@guybedford guybedford released this Jun 4, 2015 · 994 commits to master since this release

Assets 2

This is a big release of SystemJS that has been a long time coming as part of a two-phase transition into the new loader specification. The goal was to include as much of the new behaviors as possible, along with the new SystemJS API upgrades while maintaining maximum backwards-compatibility.

Most previous code should continue to work fine, provided you set System.defaultJSExtensions: true and use System.config({...}) for configuration over setting instance methods directly. Then new best-practices and configurations are available now to start using the new API concepts.

When we finally transition to the new loader spec, most of the APIs should then work with only simple renaming left to do where API names change.

The documentation and getting started guide has also been fully updated to the new APIs.

See also the Module Loader 0.17 release notes at https://github.com/ModuleLoader/es6-module-loader/releases/tag/v0.17.0.

Features

  • New builds which no longer require es6-module-loader.js, but including just the necessary parts from it. This reduces the total size of SystemJS from 16KB to 12KB and 9.5KB for the production-only CSP build.
  • A separate polyfills build for URL and Promise is now included in system-polyfills.js file, which is loaded only when needed (mainly IE) just like we used to do for es6-module-loader.js.
  • TypeScript transpiler support
  • URLs are now fully supported as module names
  • Named exports are now provided for CommonJS modules (#334)
  • New global shim layer allowing globals dependent on modules
  • Plugins can now be set via configuration, with a Webpack-style loader meta
  • New packages configuration to replace contextual map
  • Meta configuration can now be set with wildcards, and will be additive
  • SystemJS will now automatically load with a script tag for maximum CSP-compatibility when loading AMD, System.register or globals without custom shim options set.

Breaking Changes

  • Setting ".js" extensions via paths rules like paths['*'] = '*.js' is no longer supported.
  • URLs are now first-class module names. All names are normalized into URLs into the registry as part of the normalization process, and the locate hook has been deprecated. Read whatwg/loader#52 for more information about this.
  • .js extensions should not be added automatically. This is now included by default, with a backwards-compatibility mode which can be enabled via System.defaultJSExtensions = true;.
  • When configuring SystemJS, it is now necessary to always use System.config({}) as configuration options need to be normalized properly into URLs. The benefit of this is meta syntax is much easier to set as it now permits any valid specifier eg System.config({ meta: { './local/module.js': {...} } })
  • init function has been deprecated for global shims.
  • Global shim layer dependency global reconstruction is deprecated for the new globals config option.
  • System.clone is now deprecated in favour of basic class inheritance (eg class CustomLoader extends System.constructor)
  • It is no longer possible to provide map configuration which maps into plugins (map: { jquery: 'some!plugin' })
  • __moduleAddress is no longer available in ES6 modules, as __moduleName is now the URL reference

Authors who have created custom extension work on top of SystemJS will have more breaking changes, please feel free to post an issue if you have any questions at all.

Deprecations for 0.19

The following deprecations are changes that are going to be deprecated in the 0.19 major release of SystemJS
but will continue to work for now.

It is advisable to upgrade code to use the newer conventions described.

  • Contextual map configuration has been deprecated for package map configuration. Map config therefore should now only map strings to strings. Read about package configuration here.
  • The "es6" module format is now referenced as "esm" meaning ES6 Module. The point being that it refers to the module format itself and not the language or language version.
  • The dependency meta syntax "deps jquery" has been deprecated for an array syntax "deps[] jquery" to indicate that the metadata value being populated is an array.
  • There have been two variations of System.register - one with 3 arguments for ES6 modules and another with 4 arguments for CommonJS and globals to be converted into by SystemJS Builder. This 4-argument form is renamed to System.registerDynamic. SystemJS builder will handle this upgrade path naturally, so there isn't too much to worry about here.