GithubHelp home page GithubHelp logo

stealjs / steal Goto Github PK

View Code? Open in Web Editor NEW
1.4K 42.0 522.0 67.42 MB

Gets JavaScript

Home Page: https://stealjs.com

License: MIT License

JavaScript 98.22% HTML 1.77% CSS 0.01% CoffeeScript 0.01% Handlebars 0.01% Less 0.01%
javascript stealjs module-loader amd build-tool commonjs module-bundler plugins web

steal's Introduction

steal

Join our Slack Join our Discourse License: MIT npm version Travis build status Greenkeeper badge

Sauce Test Status

In addition to a collection of plugins, StealJS is comprised of two main components:

  • steal: an extensible, universal module loader.
  • steal-tools: utilities for building, transforming, and exporting module formats.

This is the steal repository. For the tools, see https://github.com/stealjs/steal-tools.

Module Loading with steal

steal is unique because it can load JavaScript modules defined in ES6, AMD, and CommonJS formats (unlike most other module loaders, which only support one of these formats at a time).

In JavaScript, the word "modules" refers to small units of independent, reusable code. They are the foundation of many JavaScript design patterns, and can look like this in ES6:

export function hello() {
  console.log('hello');
}
export function goodbye() {
  console.log('goodbye');
}

Or like this in AMD:

define([], function() {
  return {
    hello: function() {
      console.log('hello');
    },
    goodbye: function() {
      console.log('goodbye');
    }
  };
});

Or like this CommonJS:

function hello() {
  console.log('hello');
}
function goodbye() {
  console.log('goodbye');
}
module.exports = {
  hello: hello,
  goodbye: goodbye
}

All of these formats are supported by steal, so you can mix and match modules in your project:

// ES6
import { hello, goodbye } from  "greetings";

// AMD
define(["greetings"],function(greetings){ ... });

// CommonJS
var hello = require('greetings').hello;
var goodbye = require('greetings').goodbye;

Additionally, plugins make it possible to load ANY module type you might come up with, such as Less or CSS. Anyone can write a plugin for steal to extend it's core module-loading functionality.

Extending steal with Plugins

The StealJS organization maintains popular plugins that extend and enhance the module-loading capabilities of steal (and, subsequently, steal-tools) such as:

For example, the Less plugin allows Less files to be loaded similarly to JavaScript modules:

// ES6
import "style.less";

// AMD
define(["style.less"],function(){ ... });

// CommonJS
require("style.less");

// steal
steal("style.less")

Looking to create a plugin for another format? See Writing Plugins.

For more information on StealJS, visit StealJS.com.

Contributing

For information on contributing and developing, see the Contributing Guide on StealJS.com.

steal's People

Contributors

alexisabril avatar aryanj-nyc avatar asavoy avatar bmomberger-bitovi avatar ccummings avatar chasenlehara avatar cherifgsoul avatar cklanac avatar daffl avatar designbyonyx avatar eben-roux avatar frank-dspeed avatar greenkeeper[bot] avatar greenkeeperio-bot avatar ilyavf avatar janeori avatar justinbmeyer avatar leoj3n avatar m-mujica avatar marshallswain avatar matthewbauer avatar matthewp avatar mjstahl avatar phillipskevin avatar ptichonczuk-tc avatar pyr0x avatar retro avatar shcarrico avatar tracer99 avatar wclr 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

steal's Issues

Pluginify fails

Pluginify fails on every application I've tested saying:

!!!!!!!!!!! ERROR !!!!!!!!!!!

-message = "rhinoLoader" is not defined.
-fileName = eval(
rhinoLoader....):1347401223063
-lineNumber = 1
-name = ReferenceError

steal less url() paths

For some reason the paths are build really weirdly:

my original references of url(../images/smth.jpg) turns in production into: url(styles/../../app/styles/../images/smth.jpg).

Wouldn't it be better to keep the original paths? they should work in development and production mode equally

less.js @import fails when page URL contains subdirectories

I have a page loaded from http://example.com/subdir1/subdir2/page.html which steals a less file (let's call it main.less) containing @import statements:

@import "more.less";

main.less loads fine, but javascriptmvc/steal/less/less_engine.js crashes on line 2403 due to a HTTP 404 error:

Couldn't load http://example.com/subdir1/subdir2//js/myproject/more.less (404)

The URL is wrong, it should be http://example.com/js/myproject/more.less . I have a fix, but I'm not sure whether it makes things go wrong in other use cases:

simon@ubuntu:~/javascriptmvc/js/steal/less$ diff less.orig.js less.js
75c75
<               var newPath = location.href.replace(/[\w\.-]+$/, '')+

---
>               var newPath = location.protocol+'//'+location.host+

Cheers, simon

Amdify API

I've just pushed the AMDify branch of steal (along with a CanJS version that semi works for it). Most important features:

Global namespace pollution avoidance.

Say you have a file at foo/bar/bar.js that looks like:

steal(function(){
  return {bar: "bq"}
})

You can steal it like:

steal('foo/bar', function( bar ) {
  bar.bar //-> bq
})

stealconfig.js

Steal will go looking for stealconfig.js in your root folder. This is a file that can mostly specify where files/modules are located. This is very important for can's compatibility layer which needs to map can/util to something like can/util/jquery. This can be specified in stealconfig like:

steal.map({
    "can/util/util.js" : "can/util/jquery/jquery.js",
});

Also, it will be common to specify where jQuery is:

steal.map({
    "can/util/util.js" : "can/util/jquery/jquery.js",
    "jquery/jquery.js" : "can/util/jquery/jquery.1.7.1.js"
});

define / require

If define or require are used, they should work.

TODOS

  • make a solid mapping of id -> file -> id
  • make steal handle missing stealconfig.js

steal within HTTPS iframe within HTTP page causes IE8/IE9 to throw security exception

I ran into a very strange occurrence today with steal which took a long time to figure out.

The situation is, I had an http main page. Inside of the page, I programatically created an iframe which included an https page. The https page used steal to include it's javascript. IE8/9 both threw an error (SEC 7111) when attaching the iframe to the outer page's DOM, which is a "mixed mode" security error.

When including steal and the files that steal includes, I do not specify the protocol. Looking at IE's network analyzer, the iframe contents and all JS files are requested using HTTPS (as expected). IE throws SEC7111 error,

As soon as I remove steal.js and instead replace it with the files that steal.js is including, everything works fine, there is no security error, everybody is happy again.

steal/build fails silently on https

Create a steal app where myapp/myapp.js contains the following line, and build it:

steal('https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js');

The jQuery code is neither packaged into production.js, nor is it imported by the steal() call that appears in production.js

If we change the https to http, it works.

Unit tests hang if steal/less is included

If you include the steal/less plugin, the unit tests run on Rhino (the command line) without problems BUT the script "hangs" at the end (that means the prompt does not appear anymore, at least on Ubuntu Linux). Seems like something in less prevents Rhino from exiting.

This is my quick fix:

if (!navigator.userAgent.match(/Rhino/)) {
... Plugin Code ...
} else {
    steal.less = function () {};
}

Does somebody have an idea what causes this behavior? Is my fix acceptable or does it cause any problems? Of course you can not test less on the command line like this... not sure if this ever worked or if the test was supposed to run in the browser env only anyways?

Sweep out custom code pieces while build

Steal is able to sweep out seal.dev.log from the code.

Is it possible to make steal sweep it out some other configured code pieces?

For example I use "slog" or "swarn" shortcut for steal.dev.log in my code.

Steal does not work in IE anymore

Opening steal/test/qunit.html (or a project) in IE9 results in an error message saying "not enough stack space" (translated).
This seems to be caused by an endless loop in steal as a profiling run shows something "loopy" between 'require_continue_check' and 'require'.

\wsteal.js filenames in Steal cause problems

Filenames containing any \wsteal.js cause DocumentJS (probably Steal in general) to load files twice. When generating the JavaScriptMVC documentation this problem occurs in steal/get/dummysteal.js and causes certain Documentation blocks to be rendered twice. Renaming it to dummy.js fixes the problem.

Building a less-stylesheet results in broken data-urls in production.css

I have a less script containing some data-urls for small icons. After I build my app with the provided build script from jMVC, the generated code in production.css prefixes my data-urls with a reference to the jMVC application root, thus messing up the images they are supposed to represent. For example:

background-image: url(data:image/png;base64,...);

after building, is represented in the generated production.css as (my app resides in a folder called tova)

background-image: url("../../tova/data:image/png;base64,...");

However, the less script still works fine while running the app in development mode.

Update to LESS 1.3.0

In the past I've had mixed results trying to overwrite less_engine.js with a more up to date LESS (Rhino) release so I thought I should open an issue. The new @media stuff is nice and Twitter Bootstrap 2.0.2+ requires it to build.

clean.js doesn't support all command line arguments

I needed clean.js to support more options from the command line. See patch.

Patch:

diff --git a/steal/clean/clean.js b/steal/clean/clean.js
index 1c55909..1394dfe 100644
--- a/steal/clean/clean.js
+++ b/steal/clean/clean.js
@@ -94,11 +94,11 @@ steal.plugins('steal/build').then('//steal/clean/beautify','//steal/clean/jslint
     */
    steal.clean = function(url, options){
        options = steal.extend(
-           {indent_size: 1, 
-            indent_char: '\t', 
-            space_statement_expression: true,
+           {space_statement_expression: true,
             jquery : false},
            steal.opts(options || {}, {
+        indent_size: 1, 
+        indent_char: '\t', 
                //compress everything, regardless of what you find
                all : 1,
                //folder to build to, defaults to the folder the page is i

apps.js (multi-build) should be more careful when joining scripts, affects steal loading

I'm running JavascriptMVC 3.1 without updating. I had issues with multi-build in my app, where in production mode only, my page's main controller was not be initialised (i.e. the callback in the "then()" clause), even though its dependencies were being loaded. Works in dev mode. I've described the details in a post on the forums: http://forum.javascriptmvc.com/#Topic/32525000000609003

In steal/build/apps/apps.js:181 there is a line:

var source = "steal('//" + paths.join("'\n,'//") + "');\nsteal.end();\n" + src.join(";steal.end();\n"),

which joins scripts into a single package file.

This doesn't work if one of the scripts has a single-line comment at the end of the file - the packaged script ends up looking like:

steal.plugins('jquery/controller').then(function($){
}); // end closure; steal.end();

The fix is to add a newline in there, so the apps.js:181 line becomes:

var source = "steal('//" + paths.join("'\n,'//") + "');\nsteal.end();\n" + src.join("\n;steal.end();\n"),

Cannot build cookbook/recipe when stealing a less stylesheet in app

We have already a running app build with the framework. When we updated to the latest this morning we somehow isnt able to build the app anymore.

Here's whats displaying in the console:

Building to wr/
could not load script file:///c:/wamp/www/worldracers/steal/less/less_engine.js
TypeError: Cannot read property "tree" from undefined
!!!!!!!!!!! ERROR !!!!!!!!!!!

-message = Cannot read property "tree" from undefined
-fileName =
-name = TypeError
-lineNumber = 0

To verify if the issue is from our application, we tried up the javascriptmvc cookbook tutorial from scratch, from seperate directory.

Still the issue occurs when we tried to steal a less style sheet in cookbook.js. (we created cookbook.less). It displays the same result.

This is not happening from the production build that can be downloaded in jmvc's website.

Out of order loading

I have experienced some out of order loading of files with the master-version of steal. I guess it could be caused by this commit, but did not verify that assumption yet: b06aaee

More info in my comment over there

Problem in loading production script

I am bottom loading steal and mouse.js and able to successfully generate production.js
but getting an error jQuery undefined while loading production.js

Can you please help me in fixing this.

https://github.com/daffl/jqueryui/blob/master/mouse/mouse.js
https://github.com/daffl/jqueryui/blob/master/widget/widget.js
https://github.com/daffl/jqueryui/blob/master/core/core.js

// index.html

<script type="text/javascript" src="./steal/steal.js?myapp/resources/jqueryui/mouse/mouse.js,development"> // build script load("steal/rhino/rhino.js"); steal("steal/build", "steal/build/scripts", "steal/build/styles", function() { steal.build("index.html", { to : "myapp/resources/jqueryui/mouse/" }); }); // here is the snippet of production.js steal.loading('myapp/resources/jqueryui/mouse/mouse.js', 'myapp/resources/jqueryui/core/core.js', 'myapp/resources/jqueryui/widget/widget.js', 'myapp/resources/jqueryui/lib/ui/jquery.ui.mouse.js', 'myapp/resources/jqueryui/stealjquery.js', 'myapp/resources/jqueryui/lib/ui/jquery.ui.core.js', 'jquery/jquery.js', 'myapp/resources/jqueryui/lib/ui/jquery.ui.widget.js'); steal("../core/core.js", "../widget/widget.js").then("../lib/ui/jquery.ui.mouse.js"); steal.loaded("myapp/resources/jqueryui/mouse/mouse.js"); steal("../stealjquery.js").then("../lib/ui/jquery.ui.core.js"); steal.loaded("myapp/resources/jqueryui/core/core.js"); steal("../stealjquery.js").then("../lib/ui/jquery.ui.widget.js"); steal.loaded("myapp/resources/jqueryui/widget/widget.js"); (function (h) { // ../lib/ui/jquery.ui.mouse.js code }(jQuery) // ERROR // Actual jquery code is below this line

How to default to [local]/file.js if [cdn]/file.js fails.

I was reading through the documentation and blogs but couldn't find anything that described how to load a locally sourced javascript file when a cdn file fails? Ideally I'd like to load a cdn by default, but if it fails, then resort to a locally saved version of the js file.

Multi-build fails in latest steal

Updating to latest master for steal (and the other components in JavascriptMVC) and things are working correctly in dev mode, but trying to use multi-build to generate production files results in an error.

uncaught JavaScript runtime exception: TypeError: Cannot find function apps in object

Steps to reproduce

Either run the build/apps test: ./js steal/build/apps/test.js

Or:
./js jquery/generate/app pages/app1
./js jquery/generate/app pages/app2
./js steal/buildjs pages/app1 pages/app2

Further

It fails at buildjs:14 which reads steal.build.apps(urls);, which hasn't been defined.

I've tried, admittedly vainly, to update this to use steal.build.builders.app() but, this leads to an error at steal/build/apps/apps.js:150 - the return value of steal.build.open() doesn't have a "steal" property. I think that some files are not up-to-date with the changes to steal, but it's unfortunately not clear to me what needs to be updated.

I'd be happy to get more involved to fix this issue if one of the core devs could point the way, as our app needs this working to solve some other issues we're having.

Load steal less (coffee) automatically

Is it possible to make automatic dependencies for less (coffee) resources on less/coffee compiler?

now it is needed to do like:

steal(.."steal/less"...).then("style.less")

but why not do this without need to explicitly steal less plugin?

steal(.."style.less"...)

steal/buildjs exit code on fail

Running ./js steal/buildjs package/package.html returns an exit code of 0 even if an error is encountered. It is suggested that an error code of 1 should be returned if a build fails.

type() bug

type() does not work correctly with FF4 on linux ubuntu 10.10 : string is duplicated with reversed characters.

S("#someInput").type('hello") gives : helloolleh
S("#someInput").type('world") gives : worlddlrow

Steal within Steal in IE Production....

Steal within a steal does not work in IE production mode.

Example:

steal('foo.js', 'cat.js').then(function(){
steal('monkey.js').then(function(){
alert('no work');
});
});

In IE, it tries to pull the scripts from the server rather than use the production.js file. It fails shortly there after since the reference wasn't able to be pulled.

steal 3.2.1: exception with steal.loaded property set in IE8/IE9

I'm using jmvc 3.2.1 and attempting to reduce page flickering during its initialization. So I've added production.css to the head element and provided loaded property in steal global var:

<link rel="stylesheet" type="text/css" href="production.css"/>
<script type="text/javascript">
var steal = {
app: "myapp",
env: "production",
loaded: ["myapp/production.css"]
};
</script>
<script type='text/javascript' src='../steal/steal.js'></script>

I'm getting an exception in IE browsers and production.css is loaded by steal for the second time.
Other browsers work fine and production.css is requested only once in the head.

After some research I've found why IE is failing..
There is a section of a special IE treatment in steal.js
it starts with if (support.interactive) { where the function below
function(name){ var src = steals[name].options.src, interactive = getCachedInteractiveScript(), interactiveSrc = interactive.src; interactives[src] = interactives[interactiveSrc]; interactives[interactiveSrc] = null; }
is being attached on steal.loaded function.
This particular function fails on var src = steals[name].options.src line because steals["myapp/production.css"] is undefined here.
Other browsers have no issue here because an original steal.loaded is called directly.

Build Fails when Using LESS files in production

When you use LESS files in the latest master branch, set the env to 'production' in stealconfig.js , and then run the build you get:

!!!!!!!!!!! ERROR !!!!!!!!!!!

-message = Cannot read property "convert" from undefined
-fileName = file:////Users/amcdaniel2/Dev/mindjet/amcdaniel_Austin-McDaniels-MacBook-Pro/MMWebHTML/trunk/steal/steal.js?mj/ui/viewer
-lineNumber = 1511
-name = TypeError

          error loading html element  [object HTMLScriptElement]   TypeError: Cannot read property "convert" from undefined 

Infinite loop when building

When building a production version of my app using the build scripts generated by generate/app, and after I get an (already pretty cryptic) error message:

timer error  
function () {
    _this.onreadystatechange();
}
   TypeError: org.mozilla.javascript.Undefined@64811e10 is not a function, it is undefined. 

I end up in an infinite loop which continuously generates error messages like this:

timer error  
function () {
    for (var timers = jQuery.timers, i = 0; i < timers.length; ++i) {
        if (!timers[i]()) {
            timers.splice(i--, 1);
        }
    }
    if (!timers.length) {
        jQuery.fx.stop();
    }
}
   TypeError: Cannot find function removeAttribute in object [object CSS2Properties]. 
timer error  
function () {
    for (var timers = jQuery.timers, i = 0; i < timers.length; ++i) {
        if (!timers[i]()) {
            timers.splice(i--, 1);
        }
    }
    if (!timers.length) {
        jQuery.fx.stop();
    }
}
   TypeError: Cannot find function removeAttribute in object [object CSS2Properties]. 

...

and no build ever takes place. Same happens while running the generated docs.js script. I ran steal/update and jquery/update and this keeps on happening on the latest build.

production version created during multi build fails sporadically

I've tried out the latest fixes in steal with multibuild support and the production version seems to depend on the order in wich 0.js, ... package files are loaded.
even so I've properly defined dependencies for the givven file, and it works ok in development build it happens that givven js file inside production.js gets "undefined" exceptions since the dependency is not available yet.
I get such exceptions almost always when browser cache is empty,i.e. when it really needs to downlaod things.

Although as mentioned in Issue 35 multibuild currently does not support CSS. So i tried in apps.js just to ignore css the similar way as you do with "fn", so they do not get included in the production.js file

    .......
    for ( var d = 0; d < steel.dependencies.length; d++ ) {
            var dependency = steel.dependencies[d];
            if ( dependency.dependencies && dependency.options.buildType != 'fn' && dependency.options.buildType != 'css' && ! dependency.options.ignore &&  (typeof dependency.options.packaged === 'undefined'||dependency.options.packaged == false)) { //this dependency was actually loaded
                data.dependencies[dependency.options.rootSrc] = addDependencies(dependency, files, app);
            }
        }
}
......

it seems to work ok , but now I'm not sure if by this change i may have introduced the problem described above.

Custom type callback parameters documentation bug

Hi,

I am developing a custom steal type which builds Model classes from a downloaded schema. Here is a simplified version of my code:

steal.type("api js", function(options, success, error){
  var resources = $.parseJSON(options.text);

  $.each(resources, generate_model);

  options.text = "";
  success();
});

steal("jquery/model", "jquery/model/list")
  .then({
    src: "//../home?@action=api&dummy=home",
    type: "api",
    packaged: false
  }, function($) {
  "use strict";

  // da da da

});

I have had two problems:

  1. The API documentation of steal.type is this:

steal.type(type, cb( options, original, success, error )) -> undefined

But apparently the original parameter isn't used -- on the master branch today, this is at steal.js:1281.

The result of this is that my custom type was calling error() instead of success().

  1. steal() seems to add .js onto the src attribute of the object it was given.

I don't think this is always desired. Perhaps there could be an option in the object passed to steal().

My resource which contains the API is called http://localhost:8917/demo/home?@action=api . It has to be called that unfortunately. The way I work around the .js addition is by adding a dummy urlparam.

Cheers,

Rodney

steal.dev.log() chokes arguments

If the steal.dev.log() should be an adequate replacement for console.log() IMHO it should provide the same signature, ie. be able to process more than one argument:

console.log(1, 2, 3)  // outputs "1 2 3"
steal.dev.log(1, 2, 3) // outputs only "1"

I think this could be easily solved by replacing calls for console.log() in steal/dev/dev.js with something like the following:

Array.prototype.unshift.call(arguments, 'steal.js INFO:');
console.log.apply(null, arguments);

Could be similar for opera.postError() if that method also is capable of taking more than one argument.

Improve build error notification

DateJS on its own stalls the build. It has to be wrapped with $(document).ready(function(){...}) for the build to work. Its probably doing something env/rhino doesn't like, but we should look into why no helpful errors are printed.

less @import not working

Before the change in following commit:
df767ea#less/less.js

I could use @import in a less file, like this:
@import "bos_vars";
And it was woking in both build and load (prod & dev env).

In the following code, if I remove test "if (!steal.isRhino) {", it works again.

var paths = [];
if (!steal.isRhino) {
  var pathParts = options.src.split('/');
  pathParts[pathParts.length - 1] = ''; // Remove filename
  paths = [pathParts.join('/')];
}

With test (steal.isRhino), during build I get following error:

Building to cust/
failed to open file  file:/c:/wwg/test/cust/scripts/bos_vars.less   JavaException: java.io.FileNotFoundException: 
c:\wwg\test\cust\scripts\bos_vars.less (Le fichier spécifié est introuvable = unable to find file)
!!!!!!!!!!! ERROR !!!!!!!!!!!

-message    = Cannot call method "indexOf" of null
-fileName   = steal/rhino/env.js
-lineNumber = 24532
-name       = TypeError

Actually, build script try to load bos_vars.less from the build file path located in c:/wwg/test/cust/scripts and not from the "importer" less file path located in c:/wwg/test/bos

test
  /cust
    /build
      /build.js
      /build.html
  /bos
    /bos_vars.less
    /bos_icon.less <-- file importing bos_vars.less

bos_icon.less file:

...
@import "bos_vars";
...

pluginifyjs does not parse EJS correctly

I am using EJS templates in an app, but when I run pluginifyjs on it, the resulting JS file has the EJS code concatenated directly into it. Trying to load this file in a browser throws an error: "Illegal XML character '<%'". The pluginifyjs script should parse EJS code into regular JS before inserting into the final JS output, so that it is possible to embed EJS files in applications.

Make jslint error messages more pleasant to humans

Improve the jslint error messages as per this forum request:

http://forum.javascriptmvc.com/#Topic/32525000000364021

I made a gist for a patch (file: https://github.com/jupiterjs/steal/blob/master/clean/clean.js) with a better user readable error messges:

https://gist.github.com/905709

This makes error messges like:

C:\Users\nfeger\workspace\jmvc>js steal\cleanjs vigo\models\usage_logger.js -jslint true
Beautifying vigo/models/usage_logger.js

vigo/models/usage_logger.js:16: Missing semicolon.
symbol: var y = 1
location: 18
var y = 1
^

vigo/models/usage_logger.js:28: Missing semicolon.
symbol: var x = 1
location: 18
var x = 1
^
2 errors
UNUSED
11 : y
11 : x
quiting because of JSLint Errors

Improve google results for "stealjs"

When you search for "stealjs" on google, you get:

  1. A blog article from 2010 that links to StealJS.com
  2. The github page, which links to http://javascriptmvc.com/
  3. StealJS.com, a mostly blank page with no links.

It takes a minimum of four clicks (using the second search result) to get to http://javascriptmvc.com/docs.html#!stealjs

Suggested improvements:

Let me know how I can help!

(FYI: when you search for "steal.js", the second result is http://javascriptmvc.com/docs.html#!steal, but the first result is still the 2010 blog post.)

Relative paths producing invalid URL

I have a page located at '/bob/pages'. The steal directory is located at '/bob'. My javascript file is located at '/bob/pages/js/bob/headerfooter.js'.

Given the following invocation:
steal('/bob/pages/js/bob/headerfooter.js')
my javascript files load correctly. Yay!

However, if I change the invocation to use a relative path, according the leading './' syntax described here (http://javascriptmvc.com/docs.html#!steal):
steal('./js/bob/headerfooter.js')
I get a javascript error, as steal produces an invalid URL.

According to firebug, it is requesting the following:
http:/../http://localhost:8080/bob/pages/js/bob/headerfooter.js

See the "http:/.." at the start? The text after this in the URL is correct, and does point to the file it ought to, but the leading "http:/.." is causing the request to fail.

For now, having the complete path is a workaround, but it is a bit inconvenient.

unnecessary warning on "* @param {function} listener"

When I try to build a file which steals the socket.io client, I get the following warnings caused by the document comments that include the word "function". These warning shouldn't appear because this text is part of a comment.

   http://cdn.socket.io/stable/socket.io.js
tmp419760.js:1670: WARNING - Parse error. missing opening (
   * @param {function} listener
                     ^

tmp419760.js:1692: WARNING - Parse error. missing opening (
   * @param {function} listener
                     ^

0 error(s), 2 warning(s)

Production.css and base64 images urls gets errenous url

When building app a production css is generated. Jmvc adds some magic to this process, e.g. updating urls in the css etc. When using base64 encoded images in css (as shown below) there is a problem.

My css
a { background-image: url("data:image/png;base64,iV...ggg=="); }

Production css becomes
a { background-image: url("../data:image/png;base64,iV...ggg=="); }

Problem
"NetworkError: 404 Not Found ..."
the url should not be changed when handling css base64 image urls.

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.