Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES 8 / ES 2017 #485

Merged
merged 46 commits into from Jan 10, 2017
Merged

ES 8 / ES 2017 #485

merged 46 commits into from Jan 10, 2017

Conversation

sebn
Copy link
Contributor

@sebn sebn commented Jan 9, 2017

Almost complete

Remaining work (for myself):

  • Fix: Property based testing stops the two cozy-desktop instances: Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. => already failing randomly on master
  • Fix: Property based testing has the same files and folders: Uncaught AssertionError: expected 1 to be 0 ... (test/integration/quickcheck.js:324:19) => already failing randomly on master
  • Possible invalid (non tested?) use of Array.includes on a var in src/local/watcher:350
  • Should source-map-support/register go in src/bin/cli.js or in bin/cozy-desktop? (latter is spawned directly in quickcheck tests, may help debug, but can't get any output anyway)
  • Use cross-env for portable npm scripts
  • Is test/mocha.coverage.opts useful or not? => no, it works without it
  • Remove remaining useless return statements in converted code
  • Turn generated __guard__ methods in human-readable functions
  • Remove useless whateverMethod.bind(this) lines in generated class constructors => use babel-plugin-autobind-class-methods instead
  • Clean up git history (including renamed coffee -> js files)
  • Remove useless generated Array.from wrapping calls
  • Replace async with async-es?

@codecov-io
Copy link

codecov-io commented Jan 9, 2017

Current coverage is 70.00% (diff: 70.00%)

Merging #485 into master will increase coverage by 1.99%

@@             master       #485   diff @@
==========================================
  Files            14         12     -2   
  Lines          2022       1580   -442   
  Methods         434          0   -434   
  Messages          0          0          
  Branches        351          0   -351   
==========================================
- Hits           1375       1106   -269   
+ Misses          647        474   -173   
  Partials          0          0          

Powered by Codecov. Last update 51b389f...9f38b66

@sebn
Copy link
Contributor Author

sebn commented Jan 10, 2017

Some integration tests are failing (see Travis output).

This is related to the removed return statements, since they pass when resetting to the parent commit.

@sebn sebn force-pushed the es2017 branch 2 times, most recently from 041a2b5 to 6f9bb70 Compare January 10, 2017 09:34
@sebn
Copy link
Contributor Author

sebn commented Jan 10, 2017

return statements are back, tests pass, except:

  • when unexpectedly failing on node 6
  • for randomly failing quickcheck tests (that already do so on master)

sebn and others added 23 commits January 10, 2017 14:54
Including:
- Babel core and CLI
- ES6/7/8 Babel presets
- Array.prototype.includes Babel plugin
- Auto-binding of class methods Babel plugin
- Standard JS linter
- Node source map support
- nyc and babel-plugin-istanbul for coverage
Including:
- ES6/7/8 presets
- Array.prototype.includes support
- Auto-binded class methods plugins
- Istanbul instrumentation (in test env)
So we can see the git history later when running
`git log --follow` on the *.js file
A few lines of code were manually removed for coffee, then manually converted
and introduced back in js, since it was making decaffeinate crash.
…block

(Toplevel return is not ES6 module compliant)
Otherwise `this` is not binded to the test context.
This is how they are imported anyway.
Not even sure why this used to work.
So:
- we make use of the nice `import` syntax
- `require()` doesn't use default import and fails in EcmaScript

(Not sure why this used to work in CoffeeScript)
Already handled by babel-plugin-autobind-class-methods
@sebn sebn force-pushed the es2017 branch 2 times, most recently from fc8e099 to 608fd16 Compare January 10, 2017 15:50
sebn and others added 22 commits January 10, 2017 16:59
So it can also be used in scripts, including Travis:
- Use strict mode (needed for let statements)
- Use module.exports (export statement isn't supported natively)
- Passes eslint check
Lost while extracting App.registerRemote():
7fac201#diff-5213ac8fbf5fc6caa4a679def1b21649

Coffeelint never complained...
So we don't need to import it in tests anymore
Wrapping it with babel-node since it requires uncompiled es8 test helpers.
@sebn sebn merged commit 2d6b321 into master Jan 10, 2017
@sebn sebn deleted the es2017 branch January 10, 2017 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants