jspm

jest testing with es6 + jspm + systemjs + reactJS

守給你的承諾、 提交于 2019-12-02 07:39:17
I'm trying to figure out how to make my unit tests in my reactJS ES6 application. My application is already using es6 module system, transpiled with jspm/babel to systemJs. I found babel-jest as preprocessor but even with it, I can't run my tests because jest can't find SystemJs. ( "System is not defined" error is shown in the console) In the browser, as explained in jspm documentation, SystemJs is loaded globally. I guess I should load SystemJs inside my preprocessor, but How can I make systemJs available for loading additional modules in my tests? Thanks in advance Unfortunately, Jest does

Unauthorized response from GitHub API on Appveyor

谁都会走 提交于 2019-12-02 04:31:57
问题 We just started with a new project and trying to get CI working via Appveyor. It is an Aurelia web application so we need jspm on the build server. On my workstation I configured jspm manually as suggested by @guybedford in his answer below and configured my authtoken in appveyor.yml script: - jspm config registries.github.auth %JSPM_GITHUB_AUTH_TOKEN% Currently my appveyor.yml looks like this, based on the Auto configuring section from JSPM version: 1.0.{build} os: Visual Studio 2015 build:

Unexpected value 'FileUploadModule' imported by the module 'UploaderModule' - ng2-file-upload

…衆ロ難τιáo~ 提交于 2019-12-01 17:45:16
Using angular 2.0.1 (release) and ng2-file-upload 1.1.0 (latest version) I am getting the above error upon running this code. I am using jspm with systemjs to bundle my app (all fully up-to-date). import {Component, NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FileUploadModule} from 'ng2-file-upload'; @Component({ selector: 'uploader', templateUrl: '/build/templates/uploader.html' }) export class UploaderComponent { uploader = new FileUploader({url: '/upload'}); hasBaseDropZoneOver = false; fileOverBase(event) { this.hasBaseDropZoneOver = event; }

SystemJS (Aurelia with jspm) fails to load “aurelia-pal-browser” from jspm_packages folder

扶醉桌前 提交于 2019-11-30 19:56:26
I've followed the instructions at https://www.danylkoweb.com/Blog/getting-started-with-aurelia-in-aspnet-mvc-EH , step 3-5 to install Aurelia in to my asp.net mvc core app (i.e. running npm install, jspm init, jspm install aurelia-framework and jspm install aurelia-bootstrapper). My "startup code" just looks like this for now: <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> SystemJS.import('aurelia-bootstrapper'); </script> When I run the application I can see on Chrome dev tools that a lot of Aurelia resources (js files) are loaded under the /jspm

JSPM vs WebPack for Angular 2

孤街醉人 提交于 2019-11-30 19:00:31
Recently I've used JSPM for my angular 2 projects and found it very simple and convenient to work with. Both when it comes to adding new modules, and creating a bundle for production use. It's basically just: jspm install npm:@angular/somepackage and the package.json and system.js configs are updated automatically for me. When I want to create a production bundle I simply do this: jspm bundle-sfx app/main app-bundle.min.js --minify And to use it I just make an html like this: <body> <my-app>Loading...</my-app> <script src="app-bundle.min.js"></script> </body> It loads and runs fast. Used it

SystemJS (Aurelia with jspm) fails to load “aurelia-pal-browser” from jspm_packages folder

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 04:08:51
问题 I've followed the instructions at https://www.danylkoweb.com/Blog/getting-started-with-aurelia-in-aspnet-mvc-EH, step 3-5 to install Aurelia in to my asp.net mvc core app (i.e. running npm install, jspm init, jspm install aurelia-framework and jspm install aurelia-bootstrapper). My "startup code" just looks like this for now: <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> SystemJS.import('aurelia-bootstrapper'); </script> When I run the application

JSPM vs WebPack for Angular 2

时光总嘲笑我的痴心妄想 提交于 2019-11-30 03:52:36
问题 Recently I've used JSPM for my angular 2 projects and found it very simple and convenient to work with. Both when it comes to adding new modules, and creating a bundle for production use. It's basically just: jspm install npm:@angular/somepackage and the package.json and system.js configs are updated automatically for me. When I want to create a production bundle I simply do this: jspm bundle-sfx app/main app-bundle.min.js --minify And to use it I just make an html like this: <body> <my-app

jspm saying “github rate limit reached” - how to fix?

坚强是说给别人听的谎言 提交于 2019-11-29 05:46:49
问题 When I run jspm install to install JS dependencies in my Aurelia project, jspm says Github rate limit reached How to fix? 回答1: The rate limit can be lifted by configuring jspm with your Github credentials. To do this do the following: Go to github.com, login and click settings Click Personal access tokens and then Generate new token Copy the token and start command line inside the project folder Type jspm registry config github During the config process, you will be asked to enter the token.

Angular2 + Jspm.io : reflect-metadata shim is required when using class decorators

点点圈 提交于 2019-11-28 21:00:55
I am having the following problem running the below versions of JSPM with Angular2 and SystemJS (Versions: Angular@2.0.0-alpha.27 with JSPM@0.16.0-beta.2 and SystemJS@0.18.0) That once the typescript is compiled (without errors) i get the following error in the browser: /jspm_packages/npm/angular2@2.0.0-alpha.27/src/util/decorators.js:70 Uncaught reflect-metadata shim is required when using class decorators Now when i manually include the file Reflect.js: \jspm_packages\npm\reflect-metadata@0.1.0\Reflect.js that problem goes away but the next problem emerges saying list is undefined within

Angular 2: Reduce app size (in addition to bundling/minification)

天涯浪子 提交于 2019-11-28 10:07:16
I have a small-medium size (~28 KB including just the (TypeScript transpiled) JS + HTML templates) Angular 2 app. It's based originally on the angular.io quickstart , but now I am bundling/minifying it using JSPM for deployment. The bundled JS file I get is 2.1 MB, coming down to 449 KB when served with gzip compression. This is still rather large, and I would like to ask how best to go about reducing the overall size of the app for deployment, to deliver my app in the smallest and most efficient bundle. Edit : I should mention that I've reduced the uncompressed but minified bundle size to 1.9