Giter VIP home page Giter VIP logo

babel-plugin-remove-functions's People

Contributors

gavinjoyce avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

paddyobrien

babel-plugin-remove-functions's Issues

Naming

Perhaps babel-plugin-remove-call-expressions?

Support nested destructuring?

This addon supports simple destructuring but doesn't yet support nested destructuring such as:

const { run: { later }} = Ember;

I'm not sure that this type of destructuring is good practice, it seems pretty unreadable to me. I also haven't yet come across an ember app which uses this form. Also, the main motivation for this plugin to address ember-cli/rfcs#50 which doesn't include any nested functions.

Support destructuring from Ember global.

Input:

const { 
  assert,
  deprecate
} = Ember;

deprecate('message', test);
assert('message', test);
console.log(message);

Expected output:

console.log(message);

(though I don't really think we care if we leave the destructuring around)

Performance

Performance wasn't considered for the initial implementation of this. We should make changes so that the babel plugin does as little work as possible on files which don't have anything to strip

Handle global namespaces

with the config:

{
  removals: [
   {
      global: 'Ember',
      paths: [
        'deprecate' //Ember.deprecate will be removed
      ]
    }]
}

The following code:

console.log('hi there');
Ember.deprecate('this will be removed', test);
deprecate('this will NOT be removed', test);

should become:

console.log('hi there');
deprecate('this will NOT be removed', test);
``

Do we need to support additional forms of import statement?

We currently support removing functions that are imported as follows:

import Ember from 'ember';

export default Ember.Component.extend({
  didInsertElement() {
    console.log('didInsertElement');
    Ember.debug('didInsertElement'); //will be removed
  }
});

Do we need to support other types of import? eg:

import { debug } from 'ember'?

Should we handle global uses of Ember too?

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.