Code Monkey home page Code Monkey logo

ember-cli-esnext's Introduction

⚠️ This addon is deprecated in favor of https://github.com/babel/ember-cli-babel ⚠️

ember-cli-esnext

This addon inserts adds esnext processing into the javascript preprocessor for Ember CLI.

Installation / Usage

From within your Ember CLI application (must be >= 0.0.41), run the following:

npm install --save-dev ember-cli-esnext

That's all. You can now use ES6 syntax supported by esnext in your .js files.

References

ember-cli-esnext's People

Contributors

joliss avatar marcioj avatar rwjblue avatar xtian avatar zeppelin 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

Watchers

 avatar  avatar  avatar  avatar  avatar

ember-cli-esnext's Issues

jshint not respecting template strings

It seems jshint isn't respecting the template strings syntax

error:

models/group.js: line 17, col 9, 'activities' is defined but never used.
models/group.js: line 18, col 9, 'guests' is defined but never used.
models/group.js: line 20, col 9, 'activitiesText' is defined but never used.
models/group.js: line 21, col 9, 'guestsText' is defined but never used.
models/group.js: line 29, col 9, 'id' is defined but never used.

offending code:

  summary: Ember.computed('activities.[]', 'guests.[]', function() {
    var activities = this.get('activities.length');
    var guests     = this.get('guests.length');

    var activitiesText = `${activities} ${activities === 1 ? 'Activity' : 'Activities'}`;
    var guestsText     = `${guests} ${guests === 1 ? 'Guest' : 'Guests'}`;

    return `${activitiesText} ${guestsText}`;
  }),

I'm not sure if this is just a jshint setting i need to set or if this addon can somehow fix this but I wanted to bring it up.

Add support for ES6 classes to extend Ember classes (e.g. Ember.Object)

class Person extends Ember.Object {
  init() {
    // do work, son.
  }
}

This is easier to do with traceur since they abstract class creation to a runtime function $traceurRuntime.createClass. I'm not sure how we would do it with esnext. Seems like we'd have to override the output itself some how.

I have no idea how we'd support observers, computed properties, etc...This is prolly a "big picture" issue with Ember long term.

For example, this is not valid ES6:

var foo =  {
  init() {

  }.property()
  /// Unexpected token .
};

@annotations maybe?

Cannot use ES6 features that module-transpiler doesn't understand first (e.g. async/await)

Some ES6 features that esnext supports cannot be used in ember-cli. I'm guessing because the module transpiler runs over things first because esnext does not support module syntax.

Here's a simple demo repo, showing that we cannot use async functions:

https://github.com/jayphelps/ember-cli-esnext-issue-demo

// This should be valid
async function test() {}
app.js: line 20, col 1, Expected an assignment or function call and instead saw an expression.
app.js: line 20, col 6, Missing semicolon.
app.js: line 20, col 1, 'async' is not defined.

Proof it is valid and understood by esnext: https://esnext.github.io/esnext/#async%20function%20test()%20%7B%7D

Visitor.PVp.visitWithoutReset issue

Right now I'm having this issue when running my ember app.

File: admin/adapters/application.js
false == true
AssertionError: false == true
    at Visitor.PVp.visitWithoutReset (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/esnext/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:135:12)
    at Visitor.PVp.visit (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/esnext/node_modules/recast/node_modules/ast-types/lib/path-visitor.js:117:21)
    at Function.transform (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/esnext/node_modules/regenerator/lib/visit.js:31:18)
    at transform (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/esnext/lib/index.js:86:23)
    at compile (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/esnext/lib/index.js:33:9)
    at EsnextFilter.processString (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/index.js:41:16)
    at EsnextFilter.Filter.processFile (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/broccoli-filter/index.js:136:31)
    at Promise.resolve.then.catch.err.file (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/broccoli-filter/index.js:82:21)
    at $$$internal$$tryCatch (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:490:16)
    at $$$internal$$invokeCallback (/Users/esbanarango/Developer/Freelance/DeepSpaceRobots/GCC/GCC4/Admin/node_modules/ember-cli-esnext/node_modules/broccoli-esnext/node_modules/broccoli-filter/node_modules/rsvp/dist/rsvp.js:502:17)

Anyone have had this before?

Does this currently work in 0.0.34?

I've tried to use the arrow function, but it is blowing up on me.

if ( Ember.keys(myObject).any( (property) => allocation[property] >= 0.90) ) {
  dosomething();
}

Uncaught SyntaxError: Unexpected token >

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.