Skip to content

JSPM support #2233

Closed
Closed

Description

The JavaScript Package Manager, JSPM, is a frictionless package manager for JavaScript that is able to pull packages from various sources ("endpoints", as they are called), such as Node Package Manager (NPM) and Bower. Unifying all in one interface.

It also has the ability to load EcmaScript 6 modules through the System.js library that implements a loader.

One notable feature is its support for transpilers, traceur (with AtScript) and Babel (formerly e6to5), that brings the new ES6 syntax and features and makes it easy to get started with building modern JavaScript applications.

JSPM brings a dynamic developer experience that pulls dependencies on the the fly. When an app is ready to be deployed it can then be compiled and dependencies can be bundled.

The JSPM configuration-file is based on the NPM package.json format.

TypeScript should support this new ecosystem too.

Activity

  1. red010b37 commented on Mar 9, 2015

    @red010b37

    Yes please!

  2. robcleghorn commented on Mar 9, 2015

    @robcleghorn

    +1

  3. RichiCoder1 commented on Mar 10, 2015

    @RichiCoder1

    Aurelia makes extensive use of JSPM, and having worked with both I'd 👍 this.

  4. atrauzzi commented on Mar 13, 2015

    @atrauzzi

    👍

  5. ejsmith commented on Mar 17, 2015

    @ejsmith

    Yes please!

  6. RyanCavanaugh commented on Mar 17, 2015

    @RyanCavanaugh
    Member
  7. mhegazy commented on Mar 17, 2015

    @mhegazy
    Contributor

    I actually like the JSPM work flow, and we should do that :) a couple of thoughts:

    • we need a transpile(input: string): string interface on the TS side, to make the interaction with the API clean and simple
    • we need to emit into the system.js module structure, possibly a new --module system
    • finally plugin typescript support to JSPM

    PRs are definitely welcomed

  8. added this to the milestone on Mar 17, 2015
  9. basarat commented on Mar 17, 2015

    @basarat
    Contributor

    we need a transpile(input: string): string interface on the TS side, to make the interaction with the API clean and simple

    I am sure you already know : https://github.com/teppeis/typescript-simple , it now does inline sourcemaps : teppeis/typescript-simple#7 (I used it for atom/atom#5898)

  10. atrauzzi commented on Mar 17, 2015

    @atrauzzi

    We have to make sure this comes out requiring zero configuration beyond any steps needed to get typescript initially installed.

  11. basarat commented on Mar 18, 2015

    @basarat
    Contributor

    Alexander Trauzzi (@atrauzzi) I was about to start work on this but noticed from : https://github.com/jspm/registry/blob/master/registry.json#L13 that there is jspm install ts from (https://github.com/frankwallis/plugin-typescript) by Frank Wallis (@frankwallis) already.

    Is there something more required?

  12. marinasundstrom commented on Mar 18, 2015

    @marinasundstrom
    Author

    I have not evaluted the extension yet. I don't know what level of support there is.

    Can you debug the TS in the browser?

  13. frankwallis commented on Mar 18, 2015

    @frankwallis
    Contributor

    I am the author of plugin-typescript and I'm currently converting a large multi-repository project over to using it.

    It does provide source-maps so you can debug TypeScript in the browser.

    I am very interested in any feedback people have, so if you find any issues or have suggestions for improvements you would like to see then please raise issues on that repository. I will be making some minor improvements to it over the coming week.

  14. 36 remaining items

  15. OliverJAsh commented on Jun 12, 2015

    @OliverJAsh
    Contributor

    Where can I track support for bundling in jspm?

  16. OliverJAsh commented on Jun 14, 2015

    @OliverJAsh
    Contributor

    Testing https://github.com/Microsoft/TypeScriptSamples/tree/jspm/jspm with the latest jspm beta (0.16).

    I don't seem to get compile errors in the browser, e.g. this succeeds:

    function greeter(person: string) {
        return "Hello, " + person;
    }
    
    var user = [0, 1, 2];
    
    greeter(user);

    /cc Mohamed Hegazy (@mhegazy)

  17. vladima commented on Jun 14, 2015

    @vladima
    Contributor

    Oliver Joseph Ash (@OliverJAsh) complete typechecking in transpile scenarios is not possible: TypeScript compiler deliberately works within given file without attempting to resolve any references to external files (including standard library). In this circumstances it cannot build the full set of types that will be available in the program and will report lots of errors which are in fact false positives. If you want to have full-fledged editing experience with correct errors - you should use editor with TypeScript support i.e. VSCode, Sublime, Visual Studio, Atom etc. Support to compile isolated modules can be seen as merely a shortcut to avoid explicit compilation step but not the replacement for full program analysis which can be done i.e. in the editor or the compiling the whole program.
    NOTE: We consider reporting syntax errors as an option

  18. OliverJAsh commented on Jun 15, 2015

    @OliverJAsh
    Contributor

    Vladimir Matveev (@vladima) Thanks for the explanation.

    I'm looking at VSCode and the IDE plugins now. Is it possible to hook these up to SystemJS so they read the config and can parse third party dependencies, e.g. import jquery from 'jquery;`?

  19. atrauzzi commented on Jun 15, 2015

    @atrauzzi

    Oliver Joseph Ash (@OliverJAsh) That would be simply amazing. Would almost offer a first-class client side dev experience.

    I'm fairly curious about this, because I feel like there are numerous undiscovered challenges:

    • If it's a pure JavaScript package, how far can the hinting really expect to go?
    • If it's a TypeScript package, does it read built JS, or does it look somewhere for TS code?
    • If it's built JavaScript that includes the .r.js files, where should it expect to find those?
    • What if it's a package that needs to be supplemented with an r.js from another source? Any way to match the two?

    Probably more questions. But I feel like package development in JS is just insanely complex and difficult to reason about with or without TypeScript.

  20. OliverJAsh commented on Jun 19, 2015

    @OliverJAsh
    Contributor

    I don't seem to get compile errors when bundling either (now supported in jspm@0.16-beta.2). /cc Vladimir Matveev (@vladima)

    Tracking systemjs/builder#206

  21. vladima commented on Jun 19, 2015

    @vladima
    Contributor

    Technically bundling as it is done in jspm now is not a whole program analysis as it processes modules one by one. I already have a workitem in my list to add support for reporting syntax errors during transpile part in es6-module-loader and in systemjs/builder.

    Also we already have plenty of requests to add support for bunding in TypeScript compiler - is already in the roadmap (I think it is currently scheduled for 2.0).

  22. SonofNun15 commented on Feb 20, 2016

    @SonofNun15

    Currently JSPM understands typescript but the typescript compiler does not know how to resolve typings using jspm as it does with npm. This is significant for two reasons:

    1. Running tscresults in false errors because it can't load library typings. This may be able to be resolved via typings (https://github.com/typings/typings), but only via an additional typings install.
    2. VSCode shows a bunch of false errors in files, presumably because it relies on tsc to generate errors.
  23. daslicht commented on Mar 2, 2016

    @daslicht

    Is there meanwhile an example ?

  24. frankwallis commented on Mar 2, 2016

    @frankwallis
    Contributor

    Marc Wensauer (@daslicht) - you can see some jspm/typescript examples here

  25. oising commented on Mar 26, 2016

    @oising

    Josh Graber (@SonofNun15) Is there an issue tracking this?

  26. SonofNun15 commented on Mar 28, 2016

    @SonofNun15

    Oisin Grehan (@oising): yes, this one

  27. Bretto commented on Apr 27, 2016

    @Bretto

    Why is this closed ? Where can we follow the progress on this ?

  28. kitsonk commented on Apr 27, 2016

    @kitsonk
    Contributor

    It is closed because as mentioned above it is supported.

    There are the Microsoft/TypeScriptSamples which maybe a better place to focus your questions/look for answers.

  29. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions