Giter VIP home page Giter VIP logo

js.io's Introduction

js.io

js.io is a multi-platform package management and module system for JavaScript. js.io modules can be evaluated in a JavaScript runtime (e.g. node.js) or precompiled into a single package for use on the client side.

js.io provides the following:

A module system. Dependency graph that works in the client and the browser. Support and networking libraries that can be used on either platform.

run the js.io repl:

$ jsio

or run a js.io-flavored script:

$ jsio file.js	

or the js.io compiler:

$ jsio-compile

js.io's People

Contributors

alextitanium avatar arnovandervegt avatar bivald avatar carlqlange avatar chris-gc avatar chromakode avatar collingreen avatar cris avatar fairfieldt avatar geoffb avatar godefroy avatar jacoblyles avatar jishnu7 avatar jsermeno avatar jwilm avatar lamberta avatar louisstow avatar marcuswestin avatar mcarter avatar mcav avatar mgh avatar mikehenrty avatar plasma avatar rogueskib avatar tcr avatar tkazec avatar yofreke 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  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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js.io's Issues

circular references cause unexpected behavior in a few rare cases

circular references can't resolve correctly if exports is overwritten:

in module A:

exports = foo

then later in module A:

doSomeFunction()

that results in an import of module A.

expected: module A is partially defined with foo
actual: jsio doesn't pull the new exports out of the module until after the import returns, so we don't have access to foo.

Incorrect PubSub#emit() return behavior

.emit() is supposed to return whether or not the event was handled. In our implementation, it just checks for this.listeners(type).length > 0. This fails when the only listener was subscribed with .once().

jsio's import system doesn't work with node.js > v0.1.29

In v0.1.29 of node.js, promise.wait was removed. The jsio import system depends on synchronous file I/O (require() is the only exception it seems).

Looks like we might have to fall back to expose the node.js require syntax to the browser instead... :(

Callback induced memory leakage in Image caching

When using the ImageView.doOnLoad, the closure is leaked due to Callback not clearing the closures on it's "to run when fired list" after being fired.

diff --git a/packages/lib/Callback.js b/packages/lib/Callback.js
index 7a610c9..b476f20 100644
--- a/packages/lib/Callback.js
+++ b/packages/lib/Callback.js
@@ -67,6 +67,8 @@ exports = Class(function() {
                for(var i = 0, len = cbs.length; i < len; ++i) {
                        if (cbs[i]) { cbs[i].apply(this, arguments); }
                }
+               // Clear listeners to prevent leakage:
+               cbs.length = 0;
        };

        this.chain = function(id) {

The csp protocol should offer an option to batch frames

A js.io web Client in fin can generate multiple frames per second under normal usage patterns, and a fin server Connection as well. When multiple frames get generated during a configurable time period they should be sent together in a single xhr request.

can't load standalone csp

it seems that the root code wasn't actually compiled into the build. I've got a patch that should fix it.

Importing JSON files

It would be nice to support that like Node does. Could also add preprocessor support (didn't @CarlQLange do something related?).

Thoughts?

Doesn't work in Adobe AIR

I am using js.io included with Hookbox. While it works great in all the browser's I've tested it on, it fails completely in Adobe AIR. Worked a bit with mcarter tonight and we think we have the problem narrowed down to Adobe's sandbox restrictions which prevent using eval() after onLoad has fired. Would there be any way to offer a sort of .compile() function or something similar which will allow this to work around that restriction?

js.io uses deprecated node API

js.io uses node's process.compile, which gives a deprecation warning. This might also be related to another bug in which js.io import errors are uncatchable, since process.compile exits the node process on syntax errors.

ReferenceError: jsio is not defined

bonnie@bonnie-Inspiron-3543:~/WorkStation/js.io$ ./jsio <- executing jsio gives the following error
/home/bonnie/WorkStation/js.io/jsio:9
jsio('import util.optparse');
^

ReferenceError: jsio is not defined
at Object. (/home/bonnie/WorkStation/js.io/jsio:9:1)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:457:10)
at startup (node.js:136:18)
at node.js:972:3

Tilde decoding

If a tilde (~) is encoded in CSP there is an error when base64 decoding.

simple compatibility fix for nodejs 0.1.94

diff --git a/packages/jsio.js b/packages/jsio.js
index ef904d6..6105dd0 100644
--- a/packages/jsio.js
+++ b/packages/jsio.js
@@ -45,7 +45,7 @@
                if(!jsio.path.__default__) { jsio.setPath(ENV.getPath()); }
        }

-       if (typeof node !== 'undefined' && typeof process !== 'undefined' && process.version) {
+       if (typeof process !== 'undefined' && process.version) {
                jsio.setEnv('node');
        } else if (typeof XMLHttpRequest != 'undefined' || typeof ActiveXObject != 'undefined') {
                jsio.setEnv('browser');

Regards,
Jérémy.

The constructor should not be called "init".

js.io should use a different name for the overridden constructor. It is a relatively common singleton pattern to have the function that initializes the singleton called "init".

http://js.io website is down

$ telnet js.io 80
Trying 207.192.69.246...
telnet: connect to address 207.192.69.246: Operation timed out
telnet: Unable to connect to remote host

expose long poll duration in the csp.client implementation

expose the longpoll duration (du csp variable) to a higher-level api, specifically net.connect

inorder to detect disconnected clients, this duration can be used.
mcarter: the timeout is sort of tied up in the long poll duration (the shorter the longpoll duration the (potentially) more bandwidth you'll use on empty request/responses)

js.io needs XD post message

And then an XD transport using XHR in an iframe for all browsers without native XD-XHRs. This will avoid spinning issues with jsonp (e.g. possibly opera).

CSP unicode error

WARN .csp.server Unexpected Error: invalid utf-8 bytes

The unencoded JSON blob has unicode characters in it. Will follow up shortly.

Can't comment the end of an import line

Adding a comment to an import statement causes a compilation error. For example:

import lib.MyClass as MyClass; //some comment

Perhaps a problem with the regex.

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.