jspm

Rails: Can't render pages, getting JSON parse error

怎甘沉沦 提交于 2020-01-24 17:12:13
问题 I am working on a project that uses a Rails server while using JSPM to organize Javascript files while also using Sprockets to pipeline assets. My rails server works, but I cannot currently render any views. I think this has something to do with sprockets not successfully managing the processors that compiles the JavaScript. (An additional note: the JavaScript is is ES6). What the below error seems to be saying is that the server tries to render the index page, but the JSON is absent because

jest testing with es6 + jspm + systemjs + reactJS

情到浓时终转凉″ 提交于 2020-01-22 03:02:28
问题 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

How to import external NPM module with Typescript declarations using JSPM

放肆的年华 提交于 2020-01-02 07:56:26
问题 'test-module' is external module written in Typescript with index.d.ts definition file. it has properties for tsd/tsc in package.json: "typings": "dist/index.d.ts", "typescript": { "definition": "dist/index.d.ts" } 'test-module' is installed with JSPM in jspm_packages/npm/test-module for dynamic loading using SystemJS 'app' is Typescript application that imports 'test-module' like this: import {Component} from 'test-module'; The problem is that 'test-module' module HAS TO BE in both locations

Karma + JSPM + Typescript - not found '.ts.js'

…衆ロ難τιáo~ 提交于 2019-12-31 07:01:32
问题 Mainly just trying to get Karma+JSPM to play nice on loading the .ts files but having absolutely no luck. I see up a discussion repo with a stripped down example. Basically JSPM within Karma is seemingly ignoring the defaultJSExtensions: true and package level "defaultExtension": "ts" configurations when running in Karma giving the following error when attempting to load files: $ npm test > karma-jspm-typescript-coverage@1.0.0 test C:\examples\karma-jspm-typescript-coverage > karma start 18

Karma + JSPM + Typescript - not found '.ts.js'

戏子无情 提交于 2019-12-31 07:01:32
问题 Mainly just trying to get Karma+JSPM to play nice on loading the .ts files but having absolutely no luck. I see up a discussion repo with a stripped down example. Basically JSPM within Karma is seemingly ignoring the defaultJSExtensions: true and package level "defaultExtension": "ts" configurations when running in Karma giving the following error when attempting to load files: $ npm test > karma-jspm-typescript-coverage@1.0.0 test C:\examples\karma-jspm-typescript-coverage > karma start 18

How do I shim a non CommonJS, non AMD package which depends on global jQuery & lodash?

三世轮回 提交于 2019-12-23 12:39:05
问题 I am using jspm for the first time and already ran into a snag. I need to figure out how to "shim" a proprietary script which lives on our company's private npm registry. Package: widget Resides on private npm registry Is not a CommonJS, UMD/AMD module Depends on lodash and jquery , but assumes they exist on global scope Exposes Widget on the global scope Here's the (hypothetical) code var Widget = { render: function(el, symbol) { symbol = _.trim(symbol); $(el).text(symbol); } }; app.js var

Angular2 + typescript + jspm : No provider for Http ( App -> Provider -> Http )

别等时光非礼了梦想. 提交于 2019-12-23 10:19:02
问题 I trying migrate from Webpack to JSPM with system.js. We have simple App component. I was fallowing this article Angular 2 Starter Setup with JSPM, SystemJS and Typescript in atom (Part 1) import {Component} from 'angular2/core'; import {Bus} from './business.service'; @Component({ selector: 'app', template: ` <p>Hello World</p> `, providers:[Bus] }) export class App { constructor(private bus : Bus) { } } and simple (business) service with Http import {Injectable} from 'angular2/core'; import

ES6 imports - what does the exclamation mark mean?

£可爱£侵袭症+ 提交于 2019-12-21 03:53:12
问题 I'm following along with the Choose ES6 Modules Today guide, and I noticed one of the import statements he's using has an exclamation mark at the end: import 'bootstrap/css/bootstrap.css!'; What does that exclamation mark signify? This import statement appears on the first line of the startup.js file. 回答1: It means that a plugin will be called to load the file. By default the plugin/loader name equals the extension name. So in your example the css plugin will be called to load the bootstrap

JSPM Bundle with TypeScript transpiler

泪湿孤枕 提交于 2019-12-20 10:56:07
问题 I'm getting more into System.js and JSPM, where I've come to the point where I want to bundle my TypeScript source code into a JavaScript bundle. Now I can bundle my generated JavaScript code with something like: jspm bundle some/source/path someDestFile.js but then I need to pre-build all my TypeScript first into JavaScript and then bundle, finding myself left with all the compiled (and seperated) JS files. This is far from ideal! I walked through the jspm docs here, but did not find a

How to get rid off Angular Material extra styles and CSS linked by it 'forcefully'

依然范特西╮ 提交于 2019-12-19 09:07:29
问题 I am using JSPM/SystemJS I am using Angular Material and extra lib for tables (which imports Angular Material too) I also would love to use SASS ONLY version of Angular Material by @import 'angular-material.scss' BUT when I do that and link my compiled app.css I get a lot extra from Angular Material: I get multiple <style> tags in the <head> with zillion of CSS styles (?????) I get TWO extra <links> in the <head> for each import of 'angular-material.js' package with SystemJS (one from my JS