Giter Club home page Giter Club logo

gulp-traceur's Introduction

Deprecated

Deprecated as Traceur is unmaintained. Check out gulp-babel instead.


gulp-traceur Build Status

Traceur is a JavaScript.next to JavaScript-of-today compiler

Issues with the output should be reported on the Traceur issue tracker.

Install

$ npm install --save-dev gulp-traceur

Usage

const gulp = require('gulp');
const traceur = require('gulp-traceur');

gulp.task('default', () =>
	gulp.src('src/app.js')
		.pipe(traceur())
		.pipe(gulp.dest('dist'))
);

API

traceur([options])

See the Traceur options.

options

modules

Type: string
Default: commonjs
Values: See traceur modules option

By default, gulp-traceur treats all files as modules. This allows use of the export, module and import syntax. In this way the transformer can be used to compile ES2015 for AMD or Node.js environments.

traceur.RUNTIME_PATH

Absolute path to the Traceur runtime.js file.

Source Maps

Use gulp-sourcemaps like this:

const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const traceur = require('gulp-traceur');
const concat = require('gulp-concat');

gulp.task('default', () =>
	gulp.src('src/*.js')
		.pipe(sourcemaps.init())
		.pipe(traceur())
		.pipe(concat('all.js'))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('dist'))
);

License

MIT ยฉ Sindre Sorhus

gulp-traceur's People

Contributors

ai avatar amitport avatar backflip avatar douglasduteil avatar gatapia avatar guybedford avatar kevva avatar kornelski avatar lightsofapollo avatar medavid avatar sindresorhus avatar tiy-out-of-business avatar towa48 avatar vojtajina 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

gulp-traceur's Issues

error in transpiling exits gulp watch

When I have an error in my es6 code which leads to an error of the traceur transpiling process the gulp watch will be exited too...

Is there a way to prevent this...

module names are not generated (probably due to a traceur bug) when using { module: true }

When using the CLI interface from tracuer it does this:
https://github.com/google/traceur-compiler/blob/master/src/node/compile-single-file.js#L36-L38

The public api is a little different https://github.com/google/traceur-compiler/blob/master/src/node/api.js#L71

I have not tried this on node but it causes big problems if your trying to use this module to build files for the browser (my use case)... This could be a bug in the public tracuer API (or maybe its just for node)... Filing the issue here mostly so I can come back and fix it in the morning.

bug([email protected]): double sourceMaps at the end of the file

Back in the version 0.13.0 there was only one sourceMappingURL at the end of the files.

Contents of the test should generate source maps with the [email protected]

"use strict";
[].map((function(v) {
  return v + 1;
}));

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpeHR1cmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQSxDQUFDLElBQUksQUFBQyxFQUFDLFNBQUEsQ0FBQTtPQUFLLENBQUEsQ0FBQSxFQUFJLEVBQUE7QUFBQSxFQUFDLENBQUE7QUFBQSIsImZpbGUiOiJmaXh0dXJlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiW10ubWFwKHYgPT4gdiArIDEpIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9

Is it normal to have two of them in the new version 0.14.0 ?

Contents of the same test should generate source maps with the [email protected]

"use strict";
[].map((function(v) {
  return v + 1;
}));

//# sourceMappingURL=fixture.map

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpeHR1cmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQSxDQUFDLElBQUksQUFBQyxFQUFDLFNBQUEsQ0FBQTtPQUFLLENBQUEsQ0FBQSxFQUFJLEVBQUE7QUFBQSxFQUFDLENBQUE7QUFBQSIsImZpbGUiOiJmaXh0dXJlLmpzIiwic291cmNlUm9vdCI6Ii9ob21lL3gvdG1wL2d1bHAtdHJhY2V1ci9maXh0dXJlIiwic291cmNlc0NvbnRlbnQiOlsiW10ubWFwKHYgPT4gdiArIDEpIl19

I'm not sure about the use case of this;

// [...]
if (file.sourceMap) {
    fileOptions.sourceMaps = true;
}
// [...]

(extract from https://github.com/sindresorhus/gulp-traceur/blob/v0.14.0/index.js#L25 )

Setting the sourceMaps options to true is actually making traceur process the sourceMaps itself no ? (see https://github.com/google/traceur-compiler/wiki/SourceMaps)

Source map generated by gulp-sourcemaps is invalid.

The source maps generated by gulp-sourcemaps are invalid. Source maps generated by the traceur command do work correctly.

For example trying to step into the constructor on on this line does not work with the gulp generated source map. If I generate the source map with traceur --out app.js --source-maps file bootstrap.js I can step into the constructor.

For some reason, the mappings array remains empty.

Single file build

Traceur provides the ability to trace a single file and build all of its dependencies into one file. I'm not sure if that would make sense or not for this plugin.

One API for using this is described here - aaronfrost/grunt-traceur#21 (comment).

Thinking further about this, it seems to go against the principles of gulp though so perhaps we should ignore this?

sourceMaps with traceur 0.0.50

the sourceMap option doesn't work anymore, post-traceur version 0.0.50. Was this a change related to this package, or traceur itself?

Errors

Please help me understand if I am wrong, but when I hook this up to a gulp watch, it essentially throws an exception and breaks the stream (hence stops watching since its a single process.) I see you are forwarding errors, but for whatever reason it seems syntax errors in your ES6 code still throw exceptions and break the watch, I wonder if wrapping the traceur.compile call in a try catch and forwarding the error from that would solve the problem, are you open to a PR or am I just misunderstanding something?

Manually compiling with traceur produces different output

Hello,

There is a decent chance I'm doing it wrong, but it's worth a bug report anyway I think :).

If I compile a simple this simple ES6 module with traceur 0.0.31 directly I get significantly different output than when using gulp-traceur.

On a simple static HTML test page (with the traceur-runtime.js of course) the manually compiled version seems to work great. The gulp-traceur version I have not been able to get running.

core/thing.js

export class Thing {
    constructor(config) {
        console.log("Thing loaded.");
    }
}

app.js

import { Thing } from './core/thing'


export class App {
    constructor(config) {
        this.thing = Thing()
        console.log("Yip, I'm here.");
    }
}

traceur --out manual-build.js app.js core/thing.js

System.register("core/thing", [], function() {
  "use strict";
  var __moduleName = "core/thing";
  var Thing = function Thing(config) {
    console.log("Thing loaded.");
  };
  ($traceurRuntime.createClass)(Thing, {}, {});
  return {get Thing() {
      return Thing;
    }};
});
System.register("app", [], function() {
  "use strict";
  var __moduleName = "app";
  var Thing = System.get("core/thing").Thing;
  var App = function App(config) {
    this.thing = Thing();
    console.log("Yip, I'm here.");
  };
  ($traceurRuntime.createClass)(App, {}, {});
  return {get App() {
      return App;
    }};
});
System.get("app" + '');
System.get("core/thing" + '');

gulp

"use strict";
var __moduleName = "thing";
var Thing = function Thing(config) {
  console.log("Thing loaded.");
};
($traceurRuntime.createClass)(Thing, {}, {});
module.exports = {
  get Thing() {
    return Thing;
  },
  __esModule: true
};

"use strict";
var __moduleName = "app";
var Thing = require('./core/thing').Thing;
var App = function App(config) {
  this.thing = Thing();
  console.log("Yip, I'm here.");
};
($traceurRuntime.createClass)(App, {}, {});
module.exports = {
  get App() {
    return App;
  },
  __esModule: true
};

"use strict";
var __moduleName = "section_nav_controller";

index.html (test file)

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>

    <script src="libs/traceur-runtime/traceur-runtime.js"></script>

    <script type="text/javascript" src="manual-build.js"></script>
</head>
<body>
    <script>
        var config = {
        };

        console.log("Inside the script module.");

        // Bizarre module fetching syntax from the traceur compiler..
        var App = System.get("../app/app").App;

        window.app = new App(config);
    </script>
</body>
</html>

Cannot execute provided examples within the docs with or without Sourcemaps

Regardless of what variant of running gulp-traceur I get an error fromevents.js`:

Code such as the following won't work within my Gulpfile.

gulp.task('default', function () {
    return gulp.src('src/*.js')
        .pipe(sourcemaps.init())
        .pipe(traceur())
        .pipe(concat('all.js'))
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('dist'));
});

Even trying to selectively take out parts I suspected were perhaps depreciated did not fix the problem:

gulp.task "js", ->
  return gulp.src './app/assets/es6js/**/*.js'
    # .pipe plugins.sourcemaps.init()
    .pipe plugins.traceur()
    # .pipe plugins.concat 'main.js'
    # .pipe plugins.sourcemaps.write()
    .pipe gulp.dest( 'app/assets/js' ) 
    # .pipe( plugins.filter( '**/*.js' ) )
    # .pipe( reload( stream: true ) )

The exact error I get is an unhandled 'error' event for a JS file that only has let a = 2; defined:

image

Input sourceMaps not forwarded to traceur

I use gulp-sourcemaps but the sourceMaps my files have are not transmitted to traceur.

From traceur source code, we read the input source maps from the options https://github.com/google/traceur-compiler/blob/master/src/Compiler.js#L224 but this option is not populated as in gulp-traceur we create the compiler before receiving files.

I fixed my build by removing the early creation of the compiler and changed this line this way:

var compiler = new traceur.NodeCompiler(objectAssign({modules: 'commonjs', inputSourceMap: file.sourceMap}, opts));
var ret = compiler.compile(file.contents.toString(), file.relative, file.relative, file.base);

I am using traceur 0.0.87 and gulp-traceur 0.17.0

[feature proposal] allow functions in the moduleName option

Today I needed to hand-craft a gulp plugin similar to this one as I needed to dynamically calculate a module name (moduleName option) based on the input file path.

Would you be open to suggestion of supporting moduleName being a function that would be executed with the input file path (or the whole vinyl file) to calculate module name as string?

Experimental options - async/await

I specifically want to use traceur to use async/await. As far as I understand, this needs to be enabled by passing experimental flag to traceur.

Over here https://github.com/sindresorhus/gulp-traceur#traceuroptions it states that you should just pass whatever options you want to pass to the traceur compiler to the constructor of the gulp-traceur task. As you can see, I did this in my setup.

gulp.task('trac', function () {
    return gulp.src('./scripts/**/*.js')
        .pipe(traceur({experimental: true}))
        .on('error', function (err) {
          console.error('Error', err.message);
        })        
        .pipe(sourcemaps.init())
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('./dist/js')); 
});

To test the setup, I copied this code I found on the interwebs into my files:

function promisingOperation() {
    return new Promise(function(resolve, reject) {
        setTimeout(function() {
            if( Math.round(Math.random()) ){
                resolve('Success!');
            }
            else{
                reject('Failure!');
            }
        }, 1000);
    });
}

(async function () {
    var message = await promisingOperation();
    console.log(message);
})(); 

But when the gulp task runs, it gives me this output:

Error filename:line:char: Semi-colon expected, which points to just after the await statement.
So it seems to me like it's not enabling the experimental features correctly?

inline option not working

Every time I try to transpile a JS file it breaks when it's has the "inline" option, AMD and CJS options are working fine. When I use traceur in the command line it works fine.

This is the error I got.

events.js:72
        throw er; // Unhandled 'error' event
              ^
TypeError: Cannot call method 'replace' of undefined
    at InlineModuleTransformer.getTempVarNameForModuleName (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:13434:33)
    at InlineModuleTransformer.wrapModule (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:17912:25)
    at InlineModuleTransformer.transformModule (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:13452:25)
    at Module.transform (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:6122:26)
    at InlineModuleTransformer.transformAny (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:11621:27)
    at FromOptionsTransformer.append (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:22181:55)
    at eval (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:21125:16)
    at Array.every (native)
    at FromOptionsTransformer.transform (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:21124:30)
    at Compiler.treeToTree (eval at <anonymous> (/Users/cabrera/htdocs/gulp-core-slim-sass-es6/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:22437:41)

support sourcemapPath option

similar to gulp-ruby-sass please support sourcemapPath option.
my ES6 files with standard .js extension are kept at app/scripts and generated ES5 files with extension .js are kept in .tmp/scripts.
both app/* and ./tmp/* are exposed in -order- to browser-sync server and browser get confused where to get source files.
with sourcemapPath I could create a virtual path (scripts/src -> app/scripts) to source files that could point to app/scripts

No sourcemaps produced when using traceur 0.0.72

gulp task:

var gulp = require('gulp');
var traceur = require('gulp-traceur');

gulp.task('default', function () {
    return gulp.src('src/test.js')
        .pipe(traceur({sourceMaps:true, blockBinding:true, experimental:true}))
        .pipe(gulp.dest('dist'));
});

with test.js looking like this:

{
  let x = 1;
}
console.log('Hello ${x}');

produces the es5 file in the "dist" directory but no sourcemap. No exception has been thrown.

This works fine:

traceur --source-maps --block-bonding true --out dist/test.js src/test.js 

Getting empty mappings

Running the following:

gulp.task('default', function(){
  gulp.src('js/**/*.js')
    .pipe(plumber())
    .pipe(sourcemaps.init())
    .pipe(traceur())
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest('dist/js'));
});

Gives me the map files but the names and mapping keys are empty in the map files:

..."names":[],"mappings":""...

and I can't set any breakpoints. Am I missing something?

Allow input source map

As it's no possible to concat to one file with no modules it's good to support input source map. So it will be possible to concat first (and get a source map) then traceur with input source map and get compilled file with new source map.

Mapped error stack traces

Hi,
is there any way to get mapped stack traces when error is thrown?

I tried following example code and ended with source maps generated, but it would be nice if these source maps could be used to map error stack traces to original locations. Is there any way to achieve that?

I read this article describing how to achieve that with babel transpiler. I tried the same with traceur but it didn't work.

gulp.task('default', function () {
    return gulp.src('src/*.js')
        .pipe(sourcemaps.init())
        .pipe(traceur())
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('dist'));
});

Thanks for reply.

Update to Traceur v0.0.66+

Traceur v0.0.66 was just released. Careful though โ€“ it looks like there have been breaking changes, as simply updating package.json causes the tests to fail (not sure why; else I would have submitted a patch).

example gulpfile to generate sourcemaps doesn't

I added this comment to the end of another issue, but maybe it wasn't seen because that issue was already closed.

I created a Github repo to demonstrate the problem. I made it as simple as possible. My gulpfile matches the example in the documentation with one exception, I don't want to concatenate files. I want a separate sourcemap file for each .js file in the src directory. Run "gulp" and notice that no .map files get created.

https://github.com/mvolkmann/gulp-traceur-demo.git

Upgrade to [email protected]

This is blocking some ongoing work I'm doing on angular to get fix some of the issues with webkit/javascriptcore.

Thanks!

Project Traceur dependency

From the package.json I see that the version of Traceur being used is 0.0.58.
As of now, Traceur is already at 0.0.72.

Since new features and bug fixes have been introduced with the newer versions of Traceur, when will the project update the version of this dependency?

I would've forked and tried to update it myself, but I have never worked with this codebase to be comfortable doing it.

Traceur runtime

Could the module expose (or include) the traceur runtime in some way, much like the traceur module does. So I can do something like:

var traceur = require('gulp-traceur')

gulp.task('traceur', function () {
  return gulp.src([traceur.runtime, './src/**.js']) // <- Include the file I need.
    .pipe(traceur({ modules: false }))
    .pipe(gulp.dest('dest/traceur'))
})

['/node_modules/gulp-traceur/node_modules/traceur/bin/traceur-runtime.js', './src/**.js'] is just not as pretty.

sourcemaps

I can get gulp-traceur to generate sourcemap files, but I haven't been able to get them to work in Chrome or Firefox. When I look at a .js file in the debugger, I see the generated ES5 code, not the original ES6 code. Here's a snippet from my gulpfile.js that generates both the ES5 and sourcemap files:

gulp.task('transpile', ['jshint'], function () {
  return gulp.src(paths.jsNext).
    pipe(plumber()).
    pipe(changed(buildDir, {extension: '.js'})).
    pipe(sourceMaps.init()).
    pipe(traceur({experimental: true})).
    //pipe(sourceMaps.write()). // doesn't work!
    pipe(sourceMaps.write('.')). // works
    pipe(gulp.dest(buildDir));
});

This generates ES5 .js files in a "build" directory where my index.html expects to find them.
It also generates .js.map files in the same location as the corresponding .js files.

I wonder if it has anything to do with this. At the bottom of one of my generated .js files, filters.js, I see this:

//# sourceMappingURL=../share/filters.js.map

That is a correct path to filters.js.map. Inside that file I see this:

{"version":3,"sources":["share/filters.js", ...

That is not a correct path back to filters.js because it is missing the "../" part.

bundle dependencies

Hi,
If I use traceur with the --out filename parameter, the compiler resolves all dependencies and puts them in a single output file. How would I use gulp traceur to do the same? I'm using gulp-traceur 0.5.0 and the {modules: 'register'} option. This works fine, but it does not resolve dependencies.

Document default output is CommonJS

This would be useful for first-time users to understand the output format.

Could one combine it with a Browserify gulp process to browserify ES6 modules?

Also Traceur needs an update, which should with some luck work out of the box (no big API changes I don't believe).

Some suggestions!

Compiled output file inconsistent with traceur from command line

I am trying to use gulp-traceur to watch my files and generate a concatenated, compiled file with modules of type 'register'. However, the compiled file generated is not working and is inconsistent with the output file generated when running traceur from the command line:

My directory structure:

app/app.js
app/modules/home.js

app/app.js
import {homeModule} from './modules/home/home';

app/modules/home.js
export var homeModule = angular.module("Home", []);

This is generated from gulp-traceur:

System.register((void 0), [], function() {
  "use strict";
  var homeModule = System.get("modules/home/home").homeModule;
  var appModule = angular.module("App", ["ui.router"]);
  return {};
});

Note the (void 0), which is generating a message of 'TypeError: module name must be a string, not undefined' in the browser. Grunt-traceur had this error also and fixed it here:

aaronfrost/grunt-traceur@954c18b

I attempted to fix this by the same general approach but was also having ordering issues of how the modules were added to the compiled file.

Compiling from traceur CLI works fine with the following:

traceur app/app.js --out app/dist/cli.js --modules=register

and generates an output file of (note the module names populated with relative pathing to my output file)

System.register("../modules/home/home", [], function() {
  "use strict";
  var __moduleName = "../modules/home/home";
  var homeModule = angular.module("Home", []);
  return {get homeModule() {
      return homeModule;
    }};
});
System.register("../app", [], function() {
  "use strict";
  var __moduleName = "../app";
  var homeModule = System.get("../modules/home/home").homeModule;
  var appModule = angular.module("App", ["ui.router"]);
  return {};
});
System.get("../app" + '');

Not sure if this is a matter of versions with traceur itself. Current gulp-traceur uses 0.0.58 and I am using 0.0.72 from the CLI.

errs.join is not a function

/home/user/project/node_modules/gulp-traceur/index.js:40
this.emit('error', new gutil.PluginError('gulp-traceur', errs.join('\n'), {
^

TypeError: errs.join is not a function
at DestroyableTransform._transform (/home/user/project/node_modules/gulp-traceur/index.js:40:66)
at DestroyableTransform.Transform._read (/home/user/project/node_modules/gulp-traceur/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (/home/user/project/node_modules/gulp-traceur/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/home/user/project/node_modules/gulp-traceur/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/home/user/project/node_modules/gulp-traceur/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at DestroyableTransform.Writable.write (/home/user/project/node_modules/gulp-traceur/node_modules/readable-stream/lib/_stream_writable.js:194:11)
at write (/home/user/project/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/home/user/project/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/home/user/project/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:664:5)
at emitNone (events.js:67:13)

Modules

Need some way to support module loading. Since traceur only converts import statements to requires, and browserify expects only a single entry point. It means in essence you can't use traceur except for concating files yourself. Need a solution for this.

Unexpected reserved word import

I'm trying to use the import feature in ES6 and use a Google material design component in my website. In my scripts.js file I have
import {MDCDialog, MDCDialogFoundation, util} from '@material/dialog';

[EDIT] When I run traceur in gulp I get the following error:

MultipleErrors in plugin 'gulp-traceur' Message:
scripts.js:1188:5: Unexpected reserved word import
scripts.js:1188:12: Semi-colon expected

What am I doing wrong? Thank you!

0.14.0 Traceur Runtime Is Missing

With "0.14.0"

 var ctxName = createPrivateName();
TypeError: undefined is not a function
    at out (/home/one/github/encore-ui-template/node_modules/gulp-traceur/node_modules/traceur/bin/traceur.js:538:17)
    at Object.<anonymous> (/home/one/github/encore-ui-template/node_modules/gulp-traceur/node_modules/traceur/bin/traceur.js:641:3)
    at Module._compile (module.js:456:26)
    at Object.<anonymous> (/home/one/github/encore-ui-template/node_modules/gulp-traceur/node_modules/traceur/src/node/traceur.js:24:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)

sourceMaps not working

I haven't been able to get source maps to work.
I set the option sourceMaps to true, but don't get any maps.
I traced through the code in index.js and saw this:

if (ret.generatedSourceMap && file.sourceMap) {
applySourceMap(file, ret.generatedSourceMap);
}

I do have a value for ret.generatedSourceMap, but I don't have a value for file.sourceMap.
I don't know if I've stumbled across a bug or if these is something else I need to do to make that get set.

Allow compile with no modules

It would be nice to compile files without modules (if the are not used) and since without 'use strict' as it done in troucer.

npm install error

Hi, I get the following error while installing the package:

[20:11:54] ~/Projects/wdc-web> npm install -S gulp-traceur
npm http GET https://registry.npmjs.org/gulp-traceur
npm http 304 https://registry.npmjs.org/gulp-traceur
npm http GET https://registry.npmjs.org/gulp-util
npm http GET https://registry.npmjs.org/object-assign
npm http GET https://registry.npmjs.org/through2
npm http GET https://registry.npmjs.org/traceur/0.0.74
npm http GET https://registry.npmjs.org/vinyl-sourcemaps-apply
npm http 304 https://registry.npmjs.org/gulp-util
npm http 304 https://registry.npmjs.org/through2
npm http 304 https://registry.npmjs.org/object-assign
npm http 304 https://registry.npmjs.org/traceur/0.0.74
npm http 304 https://registry.npmjs.org/vinyl-sourcemaps-apply
npm http GET https://registry.npmjs.org/source-map
npm http GET https://registry.npmjs.org/readable-stream
npm http GET https://registry.npmjs.org/xtend
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/dateformat
npm http GET https://registry.npmjs.org/lodash._reinterpolate
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/lodash.template
npm http GET https://registry.npmjs.org/minimist
npm http GET https://registry.npmjs.org/multipipe
npm http GET https://registry.npmjs.org/vinyl
npm http GET https://registry.npmjs.org/rsvp
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/regexpu/0.3.0
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/source-map-support
npm http 304 https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/xtend
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/lodash._reinterpolate
npm http 304 https://registry.npmjs.org/dateformat
npm http 304 https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/isarray/0.0.1
npm http GET https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/lodash.template
npm http 304 https://registry.npmjs.org/minimist
npm http 304 https://registry.npmjs.org/multipipe
npm http 304 https://registry.npmjs.org/vinyl
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/supports-color
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/has-ansi
npm http GET https://registry.npmjs.org/escape-string-regexp
npm http GET https://registry.npmjs.org/strip-ansi
npm http 304 https://registry.npmjs.org/isarray/0.0.1
npm http GET https://registry.npmjs.org/lodash.defaults
npm http GET https://registry.npmjs.org/lodash.escape
npm http GET https://registry.npmjs.org/lodash._escapestringchar
npm http GET https://registry.npmjs.org/lodash.templatesettings
npm http GET https://registry.npmjs.org/lodash.keys
npm http GET https://registry.npmjs.org/lodash.values
npm http GET https://registry.npmjs.org/duplexer2/0.0.2
npm http GET https://registry.npmjs.org/clone
npm http GET https://registry.npmjs.org/clone-stats
npm http 304 https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/get-stdin
npm http GET https://registry.npmjs.org/meow
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/source-map-support
npm http 304 https://registry.npmjs.org/rsvp
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/has-ansi
npm http 304 https://registry.npmjs.org/escape-string-regexp
npm http 304 https://registry.npmjs.org/strip-ansi
npm http 304 https://registry.npmjs.org/source-map
npm http 304 https://registry.npmjs.org/lodash.defaults
npm http 304 https://registry.npmjs.org/lodash.escape
npm http GET https://registry.npmjs.org/amdefine
npm http 304 https://registry.npmjs.org/lodash.templatesettings
npm http 304 https://registry.npmjs.org/lodash.keys
npm http 304 https://registry.npmjs.org/supports-color
npm http 304 https://registry.npmjs.org/lodash.values
npm http 304 https://registry.npmjs.org/regexpu/0.3.0
npm http 304 https://registry.npmjs.org/clone
npm http 304 https://registry.npmjs.org/clone-stats
npm http GET https://registry.npmjs.org/ansi-regex
npm http GET https://registry.npmjs.org/ansi-regex
npm http 304 https://registry.npmjs.org/get-stdin
npm http 304 https://registry.npmjs.org/meow
npm http GET https://registry.npmjs.org/camelcase-keys
npm http GET https://registry.npmjs.org/indent-string
npm http GET https://registry.npmjs.org/recast
npm http GET https://registry.npmjs.org/regenerate
npm http GET https://registry.npmjs.org/regjsparser
npm http GET https://registry.npmjs.org/regjsgen
npm http 304 https://registry.npmjs.org/amdefine
npm http GET https://registry.npmjs.org/source-map/0.1.32
npm http 304 https://registry.npmjs.org/camelcase-keys
npm http 304 https://registry.npmjs.org/indent-string
npm http GET https://registry.npmjs.org/camelcase
npm http GET https://registry.npmjs.org/map-obj
npm http GET https://registry.npmjs.org/repeating
npm http 304 https://registry.npmjs.org/lodash._escapestringchar
npm http GET https://registry.npmjs.org/lodash._shimkeys
npm http GET https://registry.npmjs.org/lodash._escapehtmlchar
npm http GET https://registry.npmjs.org/lodash._reunescapedhtml
npm http GET https://registry.npmjs.org/lodash._isnative
npm http GET https://registry.npmjs.org/lodash.isobject
npm http GET https://registry.npmjs.org/lodash._objecttypes
npm http 304 https://registry.npmjs.org/duplexer2/0.0.2
npm http 304 https://registry.npmjs.org/ansi-regex
npm http 304 https://registry.npmjs.org/ansi-regex
npm http 304 https://registry.npmjs.org/source-map/0.1.32
npm http 304 https://registry.npmjs.org/camelcase
npm http 304 https://registry.npmjs.org/map-obj
npm http 304 https://registry.npmjs.org/regenerate
npm http 304 https://registry.npmjs.org/repeating
npm http 304 https://registry.npmjs.org/recast
npm http GET https://registry.npmjs.org/is-finite
npm http 304 https://registry.npmjs.org/lodash._escapehtmlchar
npm http 304 https://registry.npmjs.org/lodash._reunescapedhtml
npm http GET https://registry.npmjs.org/lodash._htmlescapes
npm http 304 https://registry.npmjs.org/lodash._isnative
npm http 304 https://registry.npmjs.org/lodash.isobject
npm http 304 https://registry.npmjs.org/lodash._objecttypes
npm http 304 https://registry.npmjs.org/is-finite
npm http 304 https://registry.npmjs.org/lodash._htmlescapes
npm http 304 https://registry.npmjs.org/lodash._shimkeys
npm http 304 https://registry.npmjs.org/regjsparser
npm http 304 https://registry.npmjs.org/regjsgen
npm http GET https://registry.npmjs.org/jsesc
npm http GET https://registry.npmjs.org/esprima-fb
npm http GET https://registry.npmjs.org/private
npm http GET https://registry.npmjs.org/cls
npm http GET https://registry.npmjs.org/ast-types
npm http GET https://registry.npmjs.org/depd
npm http 304 https://registry.npmjs.org/ast-types
npm http 304 https://registry.npmjs.org/esprima-fb
npm http GET https://registry.npmjs.org/esprima-fb/-/esprima-fb-7001.1.0-dev-harmony-fb.tgz
npm http 200 https://registry.npmjs.org/esprima-fb/-/esprima-fb-7001.1.0-dev-harmony-fb.tgz
npm http 304 https://registry.npmjs.org/jsesc
npm http 304 https://registry.npmjs.org/depd
npm http 304 https://registry.npmjs.org/private
npm ERR! Error: invalid version: 7001.0001.0000-dev-harmony-fb
npm ERR!     at validVersion (/usr/lib/nodejs/read-package-json/read-json.js:573:40)
npm ERR!     at final (/usr/lib/nodejs/read-package-json/read-json.js:323:23)
npm ERR!     at /usr/lib/nodejs/read-package-json/read-json.js:139:33
npm ERR!     at cb (/usr/lib/nodejs/slide/lib/async-map.js:48:11)
npm ERR!     at /usr/lib/nodejs/read-package-json/read-json.js:251:40
npm ERR!     at fs.js:268:14
npm ERR!     at /usr/lib/nodejs/graceful-fs/graceful-fs.js:103:5
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/oleksandr/Projects/wdc/src/main/webapp/npm-debug.log npm

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-S" "gulp-traceur"
npm ERR! cwd /home/oleksandr/Projects/wdc/src/main/webapp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm http 304 https://registry.npmjs.org/cls
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/oleksandr/Projects/wdc/src/main/webapp/npm-debug.log
npm ERR! not ok code 0

Use peer dependencies for traceur?

Traceur is kind of special in the way that is usually used be several pieces in the whole project: gulp build, karma tests, runtime. All those different consumers should be using the same version of traceur, otherwise we might get wired run-time inconsistencies.

We had a (loongish) discussion about this in karma-runner recently and the conclusion was to move to peer dependencies:
https://github.com/karma-runner/karma-traceur-preprocessor/blob/master/package.json#L21

Could we have the same change for gulp-traceur so one can have only one version of traeur shared in the whole project?

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.