Git Product home page Git Product logo

jspm.io's Introduction

JSPM CLI

JSPM CLI is the package management of the JSPM project, supporting import map package management.

Getting Started | Documentation | FAQ


  • Resolution against node_modules for local development workflows.
  • Versioned, locked dependency management against the local package.json.
  • Tracing and installing the full dependency tree of an application.
  • Complete NPM-like module resolution that supports conditional environments and package entry points.
  • Support for a wide range of CDNs, such as jspm.io, jsDeliver, esm.sh and unpkg.
  • Import map extraction/injection into HTML files, with module preloading and integrity attributes.

See the documentation and getting started guide on jspm.org.

Contributing

Build and test workflows use Chomp.

License

Apache-2.0

jspm.io's People

Contributors

brettz9 avatar capaj avatar dandv avatar dburrows avatar ffffranklin avatar guybedford avatar notslang avatar scribu avatar subesokun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jspm.io's Issues

Bundling error

I have an application that uses jspm/systemjs and runs fine in my browser transpiling on the fly. But when I try to bundle the application, I get the same error, no matter how I call bundle/build (running jspm 0.17.0-beta.25):

D:\Work\TMobile\B2B\trunk\B2B\B2B>jspm bundle ./src/app.js ./src/bundle.js
Building the bundle tree for ./src/app.js...

err Error: Error compiling amd module "github:Leaflet/[email protected]/dist/leaflet-src.js" at jspm_packages\github\Leaflet\[email protected]\dist\leaflet-src.js
SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.
at SourceMapGenerator_applySourceMap as applySourceMap
at Compiler.getSourceMap (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\traceur\bin\traceur.js:31879:23)
at Object.exports.compile (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\systemjs-builder\compilers\amd.js:386:25)
at D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\systemjs-builder\lib\compile.js:117:43
at tryCatcher (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\bluebird\js\release\promise.js:504:31)
at Promise._settlePromise (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\bluebird\js\release\promise.js:561:18)
at Promise._settlePromiseCtx (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\bluebird\js\release\promise.js:598:10)
at Async._drainQueue (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\bluebird\js\release\async.js:143:12)
at Async._drainQueues (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\bluebird\js\release\async.js:148:10)
at Immediate.Async.drainQueues (D:\Work\TMobile\B2B\trunk\B2B\B2B\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:570:20)
at tryOnImmediate (timers.js:550:5)
at processImmediate as _immediateCallback

I don't know what the problem is, but I noted that the stack trace above accesses traceur.js. I find this odd, because I am using babel, not traceur. I've attached the config files so you can see how babel is referenced.

jspm.config.js.txt
package.json.txt

Local mirror?

It's pretty easy to end up w/ a dependency you haven't already built, and you'll time out before cloudflare gives up on you:

wget -S -O - https://dev.jspm.io/plotly.js
--2018-08-12 10:05:15-- https://dev.jspm.io/plotly.js
Resolving dev.jspm.io (dev.jspm.io)... 104.18.62.242, 104.18.63.242, 2400:cb00:2048:1::6812:3ef2, ...
Connecting to dev.jspm.io (dev.jspm.io)|104.18.62.242|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 502 Bad Gateway
Date: Sun, 12 Aug 2018 17:05:36 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 4126
Connection: keep-alive
Set-Cookie: __cfduid=d4b6efa3f1cd70be13275b5f7f2659ba21534093515; expires=Mon, 12-Aug-19 17:05:15 GMT; path=/; domain=.jspm.io; HttpOnly
CF-Cache-Status: MISS
Vary: Accept-Encoding
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Set-Cookie: cf_ob_info=502:449486996933933c:SJC; path=/; expires=Sun, 12-Aug-18 17:06:06 GMT
Set-Cookie: cf_use_ob=443; path=/; expires=Sun, 12-Aug-18 17:06:06 GMT
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Server: cloudflare
CF-RAY: 449486996933933c-SJC
2018-08-12 10:05:36 ERROR 502: Bad Gateway.

I don't mind throwing up a local server, but unlike browserfy-cdn, there's no tips how to do that. I've actually gotten some pretty nice stuff going with your code, see:

https://codepen.io/dakami/pen/ejxabR?editors=1000

But it really only works for a handful of modules right now.

Server returns 301 instead of 404

Attempting to use the CDN approach to loading System.js et al and stumbled onto a problem where it seems to be generating the wrong URL for one of the files it is trying to load (traceur-runtime in this particular case). In trying to debug this things were complicated by my browser giving an obtuse CORS related error instead of a simple 404 Not Found. It seems that requests to invalid addresses at https://jspm.io/* currently get 301 redirected to http://jspm.io. The fact that there is a redirect here and that the redirect hops from HTTPS to HTTP causes the CORS issue I was seeing. It would have saved me several minutes of confusion if, particularly for CDN or CDN-like paths, the server would respond with a proper 404 instead of a confusing 301.

Hopefully this is the right repository to post this issue to. (Now I will likely try to figure out why traceur-runtime is trying to use the wrong address and/or include it in my bundle...)

JSPM, Node, Globals, and Riot in 0.17.X

So I'm not sure exactly where this report ends up, but due to the documentation on JSPM and Node being light, I'm gonna start here.

Similar to the idea behind your react example with 0.17 doing rendering server-side, I am attempting to use Riot.js (3.8.1) server side in Node. First I tried the method in the 0.16 docs, which didn't work because of JSPM not being able to load the riot main file as a dependency. (The way they coded riot server side and their .json makes me think that's their fault kinda? But I'm guessing it works in node raw, so I'm unsure...)

Noticing that there was a browser-specific piece of the json map, my next step was to try and jspm build a bundle for node specifically. It had similar issues regarding not including the core pieces of Riot.

This is about when I found the docs on jspm run, so I tried that, and ran into an issue where it couldn't find 'document', even if I defined it as a global beforehand in a .sh file.

import Window from 'window';
var window = new Window();
var document = window.document;

import li from 'scripts/base/item-line/item-line.ctrl'

So I guess my question is: is what I'm trying in the .sh file sufficient? And/or is the riot.js map wrong given that the server file has a dependency on riot being defined before it is imported? This is what jspm yields as the .json file on an import from npm:[email protected] (Assumedly available at https://github.com/riot/riot )

{
  "main": "lib/server/index.js",
  "format": "cjs",
  "meta": {
    "*": {
      "globals": {
        "process": "process"
      }
    },
    "*.json": {
      "format": "json"
    },
    "lib/browser/*": {
      "format": "esm"
    },
    "lib/riot+compiler.js": {
      "format": "esm"
    },
    "lib/riot.js": {
      "format": "esm"
    },
    "lib/settings.js": {
      "format": "esm"
    },
    "riot.min.js": {
      "format": "amd"
    }
  },
  "map": {
    "./lib/server": "./lib/server/index.js",
    "./lib/server/index.js": {
      "browser": "./riot.js"
    }
  }
}

lib/server/index.js does require riot be defined before it runs, though. Did riot misdefine it, or jspm not pick it up, or... I don't even know.

Also, now that jspm has multiple system.config files to load, how does it know which ones to load (if any) when using jspm run? The command line help didn't indicate anything, and there wasn't any way to load them in the 0.16 way either.

Addendum: once I solved the window global issue by having the module detect whether it was in node or not, the same error popped up regarding riot not having the right setup. The error in specific is Error: Module /STUFF/web/static/jspm_packages/npm/[email protected]/riot not declared as a System.registerDynamic dependency of file:///STUFF/web/static/jspm_packages/npm/[email protected]/lib/server/index.js

JSPM makes zone.js "format cjs". Require is not defined error

Hi! Sorry for probably repetitive or obvious question. I found a couple of similar issues but no one leaded me to success
We are building an Angular2 (version 2.0.0) application where using a jspm.

From some point it turned impossible to add several libraries such as zone.js or one of it`s nested module.
It appeared that the cause is jspm loader that turns this zone.js package into commonJS format at the installation step.

After an installation there is a (function(process) {})() wrapper and "format cjs"; string in packages code.

It causes an error during application intialization:

Uncaught ReferenceError: require is not defined

I tried to set
"registry": "jspm", "format": "es6",
in package.json as was suggested in some pretty old article but it did not help

Thank you in advance

jspm.io homepage doesn't load

This may actually be a jspm registry issue but it causes http://jspm.io to hang on the spinner when loading the homepage (which I am keen to read).

It looks like the github repo referenced below has been moved to an organisation (https://github.com/showdownjs/showdown) and this may be the cause?

Unfortunately I'm travelling at the moment so investigating further may be a little tricky.

Chris

Failed to load resource: the server responded with a status of 404 (Not Found) https://github.jspm.io/coreyti/showdown.js
Uncaught Not Found: https://github.jspm.io/coreyti/showdown.js jspm.io/:536

http://jspm.io/ not loading content

The screen is blank and the browser is loading for approximately 30 seconds until the page renders with the spinner, but no content.

What I see:

What I expect:
That page, but with content below the logo and tag line instead of the spinner icon.

Steps to reproduce:

Go to http://jspm.io/ in your browser

Edit docs button

I was hoping to clarify some things the 0.17@beta Linking docs, but I'm not sure how... The docs in this repo seem to be plain html, which might be a endresult of a compilation step.
Redux, which also uses GitBook, added a Edit link ("Edit this page") to their docs which makes this easier. It looks like they use an edit-link plugin for that. Their whole book config:
https://github.com/reactjs/redux/blob/master/book.json
Wouldn't this be interesting for the JSPM's docs?

Suggestion

When showing other developers the project I generally find myself pointing them at http://jspm.io/start.html rather than the homepage.

I wonder if there would be benefit in making start.html (or at least the content of it) the first thing people see when they hit the site.

Just throwing the idea out there.

How to install private npm modules from jspm.io?

Hello, thanks for the service which help me fetch npm module in browser via jspm.io.

But there are some npm module in our private npm registry, and is there a method to fetch these npm modules via the jspm.io ?

The code below is how I use jspm.io to fetch modules in my project:

const module = await import('https://dev.jspm.io/' + moduleName);

Bundle dynamic imports

Hi,

I am using System.import to dynamically load dependencies. For example to only run certain scripts when certain elements are on the page.

jspm bundle cannot resolve these imports (naturally).

Is there any wayI can tell jspm to create a self executing bundle and feed it additional modules that need to be included although they are not present as import statements?

Thanks,

Arjen

jspm.io Access-Control-Allow-Headers does not include DNT request header

Currently, the jspm.io website doesn’t load when using Safari (v8.0) with Do Not Track enabled. Here’s what gets logged to the console:

[Error] Failed to load resource: Request header field DNT is not allowed by Access-Control-Allow-Headers. (showdown.js, line 0)
[Error] XMLHttpRequest cannot load https://github.jspm.io/showdownjs/showdown.js. Request header field DNT is not allowed by Access-Control-Allow-Headers. (jspm.io, line 0)
[Error] : https://registry.jspm.io/showdown.js
    (anonymous function) (jspm.io, line 544)

Sounds like the Access-Control-Allow-Headers just have to be tweaked to accept a DNT header?

jspm and jquery-ui-layout are not working together

I am trying JSPM and i am running into issues. I know jquery-ui-layout depends on soem of components from jquery-ui and i tried adding it before jquery-ui-layout as well
I set it up like following and I get Error

system.src.js:123 Uncaught (in promise) Error: (SystemJS) Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined

index.html

<!DOCTYPE html>
<html lang="en">

  <head>
    <script src="jspm_packages/system.js"></script>
    <script src="config.js"></script>
  </head>

  <body>
    <script>
      System.import('main.js');
    </script>
    <div class="test">
      <div class="ui-layout-center">Center</div>
      <div class="ui-layout-north">North</div>
      <div class="ui-layout-south">South</div>
      <div class="ui-layout-east">East</div>
      <div class="ui-layout-west">West</div>
    </div>
  </body>

</html>

main.js

  import $ from 'jquery';
  import 'jquery-ui-dist/jquery-ui.min';
  import 'jquery-ui-layout';
  import 'jquery-ui-layout/layout-default.css!';
$('.test').layout({
    applyDemoStyles: true
  });

config.js:

System.config({
  baseURL: "./",
  defaultJSExtensions: true,
  transpiler: "babel",
  babelOptions: {
    "optional": [
      "runtime",
      "optimisation.modules.system"
    ]
  },
  paths: {
    "github:*": "jspm_packages/github/*",
    "npm:*": "jspm_packages/npm/*"
  },

  map: {
    "babel": "npm:[email protected]",
    "babel-runtime": "npm:[email protected]",
    "core-js": "npm:[email protected]",
    "css": "github:systemjs/[email protected]",
    "jquery": "npm:[email protected]",
    "jquery-ui-dist": "npm:[email protected]",
    "jquery-ui-layout": "github:allpro/[email protected]",
    "github:allpro/[email protected]": {
      "jquery": "npm:[email protected]",
      "jquery-ui": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "assert": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "buffer": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "constants-browserify": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "crypto-browserify": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "events": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "path-browserify": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "process": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "stream-browserify": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "string_decoder": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "util": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "vm-browserify": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "bn.js": "npm:[email protected]",
      "buffer": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "minimalistic-assert": "npm:[email protected]",
      "vm": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "assert": "github:jspm/[email protected]",
      "buffer": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]",
      "util": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "buffer-xor": "npm:[email protected]",
      "cipher-base": "npm:[email protected]",
      "create-hash": "npm:[email protected]",
      "crypto": "github:jspm/[email protected]",
      "evp_bytestokey": "npm:[email protected]",
      "inherits": "npm:[email protected]",
      "safe-buffer": "npm:[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "browserify-aes": "npm:[email protected]",
      "browserify-des": "npm:[email protected]",
      "buffer": "github:jspm/[email protected]",
      "crypto": "github:jspm/[email protected]",
      "evp_bytestokey": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "cipher-base": "npm:[email protected]",
      "crypto": "github:jspm/[email protected]",
      "des.js": "npm:[email protected]",
      "inherits": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "bn.js": "npm:[email protected]",
      "buffer": "github:jspm/[email protected]",
      "constants": "github:jspm/[email protected]",
      "crypto": "github:jspm/[email protected]",
      "randombytes": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "bn.js": "npm:[email protected]",
      "browserify-rsa": "npm:[email protected]",
      "buffer": "github:jspm/[email protected]",
      "create-hash": "npm:[email protected]",
      "create-hmac": "npm:[email protected]",
      "crypto": "github:jspm/[email protected]",
      "elliptic": "npm:[email protected]",
      "inherits": "npm:[email protected]",
      "parse-asn1": "npm:[email protected]",
      "stream": "github:jspm/[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "base64-js": "npm:[email protected]",
      "ieee754": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "safe-buffer": "npm:[email protected]",
      "stream": "github:jspm/[email protected]",
      "string_decoder": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "fs": "github:jspm/[email protected]",
      "path": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "bn.js": "npm:[email protected]",
      "buffer": "github:jspm/[email protected]",
      "crypto": "github:jspm/[email protected]",
      "elliptic": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "cipher-base": "npm:[email protected]",
      "crypto": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "ripemd160": "npm:[email protected]",
      "sha.js": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "cipher-base": "npm:[email protected]",
      "create-hash": "npm:[email protected]",
      "crypto": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "ripemd160": "npm:[email protected]",
      "safe-buffer": "npm:[email protected]",
      "sha.js": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "browserify-cipher": "npm:[email protected]",
      "browserify-sign": "npm:[email protected]",
      "create-ecdh": "npm:[email protected]",
      "create-hash": "npm:[email protected]",
      "create-hmac": "npm:[email protected]",
      "diffie-hellman": "npm:[email protected]",
      "inherits": "npm:[email protected]",
      "pbkdf2": "npm:[email protected]",
      "public-encrypt": "npm:[email protected]",
      "randombytes": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "minimalistic-assert": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "bn.js": "npm:[email protected]",
      "buffer": "github:jspm/[email protected]",
      "crypto": "github:jspm/[email protected]",
      "miller-rabin": "npm:[email protected]",
      "randombytes": "npm:[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "bn.js": "npm:[email protected]",
      "brorand": "npm:[email protected]",
      "hash.js": "npm:[email protected]",
      "hmac-drbg": "npm:[email protected]",
      "inherits": "npm:[email protected]",
      "minimalistic-assert": "npm:[email protected]",
      "minimalistic-crypto-utils": "npm:[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "md5.js": "npm:[email protected]",
      "safe-buffer": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "stream": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "safe-buffer": "npm:[email protected]",
      "stream": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "inherits": "npm:[email protected]",
      "minimalistic-assert": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "hash.js": "npm:[email protected]",
      "minimalistic-assert": "npm:[email protected]",
      "minimalistic-crypto-utils": "npm:[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "util": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "util": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "assert": "github:jspm/[email protected]",
      "buffer": "github:jspm/[email protected]",
      "crypto": "github:jspm/[email protected]",
      "events": "github:jspm/[email protected]",
      "fs": "github:jspm/[email protected]",
      "path": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]",
      "systemjs-json": "github:systemjs/[email protected]",
      "util": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "hash-base": "npm:[email protected]",
      "inherits": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "bn.js": "npm:[email protected]",
      "brorand": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "asn1.js": "npm:[email protected]",
      "browserify-aes": "npm:[email protected]",
      "buffer": "github:jspm/[email protected]",
      "create-hash": "npm:[email protected]",
      "evp_bytestokey": "npm:[email protected]",
      "pbkdf2": "npm:[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "create-hash": "npm:[email protected]",
      "create-hmac": "npm:[email protected]",
      "crypto": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]",
      "ripemd160": "npm:[email protected]",
      "safe-buffer": "npm:[email protected]",
      "sha.js": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "assert": "github:jspm/[email protected]",
      "fs": "github:jspm/[email protected]",
      "vm": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "bn.js": "npm:[email protected]",
      "browserify-rsa": "npm:[email protected]",
      "buffer": "github:jspm/[email protected]",
      "create-hash": "npm:[email protected]",
      "crypto": "github:jspm/[email protected]",
      "parse-asn1": "npm:[email protected]",
      "randombytes": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "crypto": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]",
      "safe-buffer": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "core-util-is": "npm:[email protected]",
      "events": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "isarray": "npm:[email protected]",
      "process": "github:jspm/[email protected]",
      "stream-browserify": "npm:[email protected]",
      "string_decoder": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "hash-base": "npm:[email protected]",
      "inherits": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "fs": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "process": "github:jspm/[email protected]",
      "safe-buffer": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "events": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "readable-stream": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "inherits": "npm:[email protected]",
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "indexof": "npm:[email protected]"
    }
  }
});

A high-level architectural introduction to jspm

It would be nice to have a short introduction that goes through the core design decisions from a purely conceptual point of view.

Hard part is weighing up at what level to make it accessible. Would be nice to hit both sides.

Is there a typo in plugins section, on how to import json files?

In the git book it says in section 5. plugins:
import config from './config-service!json'; // ---> errors when using exclamation mark in front of json

I tried to import json file in the same manor as described for css files

import config from './config-service.json!'; // ---> imports the json

Is this a bug

I import a custom module like this:

import MaintenanceActions from '../../flux/stores/MaintenanceStore';

but failed with this error:

GET http://localhost:9000/jspm_packages/npm/[email protected]/stores/MaintenanceStore.js 404 (Not Found)

It seems that the loader parse the 'flux' to the flux module.
Is this a bug or I made some mistakes?

More basic workflow (http-server, etc.)

I've been using JSPM for a while, and just set up a new project on 0.17. It's a bit confusing to figure out how to run the dev server, and get everything up and running (the guide mentions hot loading, but not the basic dev server setup), so I thought I would mention some things that maybe could be clarified in the docs.

One unclear point is how to get a local dev server up and running. I know that's something people have some opinions about (and it gets into grunt vs gulp vs npm scripts, etc.), but maybe a quick mention that you need to run both a local server of any kind (http-server for example) and the chokadar hot load emiter would be nice. There is a package called jspm-server that doesn't appear to be compatible with 0.17.

Another thing is how to run and kill multiple services, which appears to be required for hotloading to work, from npm scripts. I know that's a general knowledge, but it's the kind of thing that could trip folks up.

Other confusing things:

  • How do I get JSPM to use a separately linked js package like jQuery - very challenging to figure out. You can't just avoid importing it either, because some other modules will probably pull in another copy. This makes it challenging to mix JSPM with something like WordPress which manages a certain set of JS libraries, or to use CDNs. (this one is in the docs, but it is for some reason unclear, at least to me - there seems to be a few different keys to set, or perhaps they are options - I really can't tell if I should use them all, or just pick one - or why, etc.)
  • How to have production html and development html at the same time (development to use separate files, or a dev bundle, and production to use a production bundle, etc.). It'd be great to have some guidance on that.

I know there are a billion ways to do all of these things, but that is part of the problem. Some sensible defaults to answer those questions would match the philosophy at the core of JSPM - to make things quick and easy.

Infinite spinner on https://jspm.io

Steps to reproduce

  1. Navigate to https://jspm.io
  2. Observe the loading indicator displays but content never renders

Actual Result
See Infinite spinner
screen shot 2015-06-18 at 4 47 55 pm

Expected Result
Should see content
screen shot 2013-07-25 at 23 38 00

Notes
showdown.js seems to hang:
screen shot 2015-06-18 at 5 26 50 pm

OS: OSX 10.10.3
Browser: Chrome Version 43.0.2357.124 (64-bit)

Loading modules from endpoints

As mentioned on es6 module loader issue, I'm having problems accessing jspm.io directly from the System loader:

If I try for example System.import('https://npm.jspm.io/es6-promise'); it returns the first file correctly with export * from "npm:[email protected]/dist/commonjs/main";. However, it then says "XMLHttpRequest cannot load npm:[email protected]/dist/commonjs/main.js. Cross origin requests are only supported for HTTP". However, if I then try to access with http, I get an empty response.

Similarly, if I try to access a file directly with System.import('xxx',{address:...}).

The msg I reported on the es6 loader issue was probably due to my requesting the wrong address, and Chrome was reporting this in a misleading way.

A transpiler question during jspm should be re-worded

While running jspm init the user gets the following question:

Do you wish to use an ES6 transpiler? [yes]:

Answering "no" results in not even showing the following question:
Which ES6 transpiler would you like to use, Traceur, Babel or TypeScript?

This sounds confusing and may the users believe that transpiling into ES6 syntax is the only option.
I'd rephrase these two questions as follows:

Do you wish to use a transpiler? [yes]:
Which transpiler would you like to use, Traceur, Babel or TypeScript?

JSPM behind Corporate Proxy

JSPM fails to work if we are running it behind corporate proxy. I have set up HTTP_PROXY as well as HTTPS_PROXY. It gives me the following error whenever i try to install any component.

Error on locate for github:components/COMPONENT_NAME
Error: unable to verify the first certificate

I couldn't find any documentation how to configure proxy for JSPM on windows. Please help.

jspm.io website should include instructions on loading website local modules

I want to build my websites via components. I want to load them using dependencies. JSPM seems to be designed to load external modules, but what about individual components.

For example can I write my main page like so:

<!DOCTYPE html>
<html lang="en">
    <head>
        <base href="/">
        <title>Simple main page</title>
        <script src="jspm_packages/system.js"></script>
        <script src="config.js"></script>
        <script>
            System.import("site/app.js");
        </script>
    </head>
    <body></body>
</html>

How do I write "site/app.js" such that it might load another module in "another/another.js" using jspm?

How does <base href="/"> play into dependencies

For example an app.js might looks like

define('app', [
    './site/app.css!',
    '../another/another.js'
    ], function ()  {
});

Also another.js might look like this:

define('another', [
    'app'
], function ()  {
});

But if I do that then jspm loads app.css twice from two locations:

index.html?_ijt=g2h6m2ugivf90um6kb774j433n  200 document    Other   632 B 405 ms    
system.js   200 script  index.html?_ijt=g2h6m2ugivf90um6kb774j433n:6    59.8 KB   25 ms 
config.js   200 script  index.html?_ijt=g2h6m2ugivf90um6kb774j433n:7    565 B 23 ms 
app.js  200 xhr system.src.js:5123  416 B 10 ms 
another.js  200 xhr system.src.js:5123  375 B 15 ms 
[email protected]    200 xhr system.src.js:5123  389 B 17 ms 
css.js  200 xhr system.src.js:5123  4.4 KB    6 ms  
app.css 404 stylesheet  css.js:72   0 B   16 ms 
app.css 200 stylesheet  css.js:72   308 B 14 ms

The two URLs for this are:
http://doublecss:63342/site/site/app.css 404
http://doublecss:63342/site/app.css 200

jspm systemjs without webserver

I am new to jspm so please excuse noobidity

I went through basic tutorials. I used jspm init with babel as transpiler.
Used index.html as mentioned in docs.
index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <script src="jspm_packages/system.js"></script>
    <script src="config.js"></script>
  </head>
  <body class="boot">
    <script>
        System.import('./js/main.js');
    </script>
  </body>
</html>

main.js

import $ from 'jquery';
$('body').append('<b1> - jquery laoded</b1>');

Now If i use http-server , and open index .html, it works.
But If I drag n drop index.html in firefox I get error since it cant find babel-core
Firefox can load local resources but systemJs fails to locate them because path is incorrect

 Failed to load resource: net::ERR_FILE_NOT_FOUND file:///D:/jspm_packages/npm/[email protected]

I setup electron environment and point electron to use same index.html, it shows same error.

How can i make it work without webserver

Primary CSS font-family falls back to browser default

The main CSS font-family declaration only specifies Myriad Pro:

      h1, h2, h3, h4, h5, h6, p, li, a {
        font-family: 'Myriad Pro';
        -webkit-font-smoothing: antialiased;
        font-weight: 100;
      }

So if the user doesn’t have it installed, it uses the browser default styles and font, which is generally a serif (Times New Roman), and which doesn’t look good in the design of the page. OS X 10.10 and iOS 7 come bundled with Myriad Set Pro, so that’s probably worth including in your stack. And you will want fallback fonts for people who don’t have Myriad. The simplest, safest bet is probably Helvetica, with a final fallback to whatever generic sans-serif.

A separate issue that comes up when I added Myriad Set Pro is that it includes an Ultralight version, which mean that combined with turning off subpixel antialiasing, the text winds up feeble and wispy. If you want a generally lighter look, I would use the regular (400) weight with subpixel-antialiasing disabled, and lighter weight (100 or 200, which are effectively the same) with subpixel-antialiasing reenabled for headings (h1 through h4, because as it stands, h5 and h6 are tiny). And I would suggest reenabling subpixel-antialiasing for inline <code> elements to (very) subtly differentiate it from the surrounding body text.

I would therefore suggest replacing the above CSS in the HTML with:

      h1, h2, h3, h4, h5, h6, p, li, a {
        font-family: 'Myriad Pro', 'Myriad Set Pro', Myriad, 'Helvetica Neue', Helvetica, sans-serif;
        -webkit-font-smoothing: antialiased;
        font-weight: 400;
      }
      h1, h2, h3, h4 {
        -webkit-font-smoothing: subpixel-antialiased;
        font-weight: 200;
      }
      code {
        -webkit-font-smoothing: subpixel-antialiased;
      }

jspm.browser.js not created with default init settings

Hey,

The documentation implies that a file jspm.browser.js will be created when I run jspm init . I think this might've been true previously, but it is not true with 0.17.0-beta.22

When I select Custom instead of Quick I see the option to have this file created.

I don't have a strong preference on whether this file should exist or not, but the documentation should align with the defaults. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.