5 ms·
I've had a lot of success using System.js and JSPM to transpile and bundle my Javascript code. I've dropped Karma altogether and I am just using the Mocha CLI f
by dimgl 11y ago
I've had a lot of success using System.js and JSPM to transpile and bundle my Javascript code. I've dropped Karma altogether and I am just using the Mocha CLI for testing. Testing Angular 1.x was such a nightmare that I kind of just gave up. I'm having a lot more success with other frameworks that are a bit smaller and do less.
- 1971genocide 11y agoI have been seeing a lot of talk about JSPM. How is it different from NPM ? since I just use it to do everything.
- theodorton 11y agoFrom what I've come to understand, JSPM works a lot like NPM, except you can pull packages both from npm and git(hub). We're using it at our startup, and it works quite well. Had to do make a custom build script to make it fit into our Rails application. Edit: JSPM biggest strength is possibly that it supports a vast set of module loaders (AMD, CommonJS and ES6 modules).
- Bahamut 11y agoJSPM also normalizes importing in ES6 from AMD, CommonJS, and ES6 (not sure about TypeScript, probably though). It is built on top of System.js, which lets you import modules and allows you to configure the local global namespace. Edit: Looks like there was a ninja edit since I started typing :)
- EvanPlaice 11y agoI was going to suggest the same. JSPM has a lot of really useful characteristics. It includes System.js which is a polyfill for the future ES6-Module-Loader spec. It also supports importing AMD/CommonJS modules. JSPM installs modules from the CLI the same way NPM does, except it's specifically geared for the client-side. Every module that gets downloaded (incl dependencies) is automatically mapped in a config.js file. JSPM has its own registry but, unlike NPM, the registry is not a requirement. It's trivial to install modules directly from GitHub and NPM. The module/dependency is flat (NPM is changing to this in V3) so there isn't any duplication of dependencies. It also supports multiple versions of a dependency if necessary so there's no 'dll hell' esque issues. JSPM comes built-in with transpiler support for Babel, Traceur, and Typescript. Using them is as simple selecting one of the three during the 'jspm init' script. It can also be used to build bundles and self-executing bundles (incl minify). The best part is, it aims to directly support the future ES standards while also providing a bridge to use older packaging formats. Browserify and Webpack are extremely popular at the moment but both will inevitably be replaced when the new module standards solidify.