Giter Club home page Giter Club logo

jupyter-js-utils's Introduction

jupyter-js-utils

Build Status Coverage Status

JavaScript utilities for the Jupyter frontend.

API Docs

Package Install

Prerequisites

npm install --save jupyter-js-utils

Source Build

Prerequisites

git clone https://github.com/jupyter/jupyter-js-utils.git
cd jupyter-js-utils
npm install

Rebuild

npm run clean
npm run build

Run Tests

Follow the source build instructions first.

# run tests in Firefox
npm test

# run tests in Chrome
npm run test:chrome

# run tests in IE
npm run test:ie

Build Docs

Follow the source build instructions first.

npm run docs

Navigate to docs/index.html.

Supported Runtimes

The runtime versions which are currently known to work are listed below. Earlier versions may also work, but come with no guarantees.

  • Node 0.12.7+
  • IE 11+
  • Firefox 32+
  • Chrome 38+

Note: "requirejs" must be included in a global context for Comm targets.

Usage Examples

Note: This module is fully compatible with Node/Babel/ES6/ES5. Simply omit the type declarations when using a language other than TypeScript.

jupyter-js-utils's People

Contributors

afshin avatar blink1073 avatar dwillmer avatar ellisonbg avatar jasongrout avatar lduchesne avatar minrk avatar npmcdn-to-unpkg-bot avatar rgbkrk avatar sccolbert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyter-js-utils's Issues

Dynamic Requires

@jdfreder @jasongrout @sccolbert @minrk

I am in favor of the following:

  1. For now, assume RequireJS is a global (script tag or global.requirejs = require('requirejs');). It has already caused problems as an import.
  2. When WebPack 2.0 is released, use System.import('dynamic/' + moduleName).

Then, we can specify that dynamic/* uses an external loader in WebPack, and add a dynamic/ handler to the server. I believe this gives us the best interoperability with all loaders and environments.

Fix getWsUrl

Should only slice the baseUrl if it starts with http.

Add a Jupyter Config loader

Add a function that retrieves a config value from the HTML page via a handlebar template in a JSON script tag.

<script id="jupyter-config-data" type="application/json">
{org: 10, items:["one","two"]}
</script>

element = document.getElementById('jupyter-config-data);

JSON.parse throws error if response isn't valid json string

This line throws an error if you try connecting to a wrong url.

To reproduce this issue try connecting to https://tmp54.tmpnb.org/user/ which will return html rather than a valid json string. The full trackeback is:

SyntaxError: Unexpected token <
    at Object.parse (native)
    at [object Object].req.onload (/Users/lukasgeiger/code/hydrogen/node_modules/jupyter-js-services/node_modules/jupyter-js-utils/lib/index.js:166:33)
    at [object Object].dispatchEvent (/Users/lukasgeiger/code/hydrogen/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
    at setState (/Users/lukasgeiger/code/hydrogen/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:614:14)
    at IncomingMessage.<anonymous> (/Users/lukasgeiger/code/hydrogen/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:447:13)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at doNTCallback2 (node.js:465:9)
    at process._tickCallback (node.js:379:17)

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.