Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

Conversation

@easleydp
Copy link
Contributor

@easleydp easleydp commented Dec 14, 2016

Solves #2445

Reason for changes: (1) To allow the Vis distributed code to be processed by YUI Compressor (e.g. via tools such as Sencha Cmd, where it can be difficult not to use a compressor). (2) Improve general JavaScript correctness.

Summary of changes:

  1. Changes to Vis application code:
    1.1) Avoid using "boolean" as a variable name because it is a JavaScript reserved word. (Used "bool" instead.)
    1.2) Avoid using "char" as a variable name because it is a JavaScript reserved word. (Used "ch" instead.)

  2. Changes to Babel configuration:
    2.1) Include the 'transform-es3-property-literals' Babel plugin to ensure that reserved words are quoted in object property keys, e.g.:
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
    rather than:
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    2.2) Include the 'transform-es3-member-expression-literals' Babel plugin to ensure that reserved words are quoted in property accesses, e.g.:
    return new _Configurator2['default'](this, this.dom.container, configureOptions);
    rather than:
    return new _Configurator2.default(this, this.dom.container, configureOptions);

Copy link
Member

@yotamberk yotamberk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you!

@eymiha
Copy link
Contributor

eymiha commented Dec 25, 2016

I've detailed the problem and solution for issue #2500 as a comment there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants