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

Move away from Esperanto, as it is deprecated #219

Closed
paulfalgout opened this issue Aug 24, 2015 · 8 comments
Closed

Move away from Esperanto, as it is deprecated #219

paulfalgout opened this issue Aug 24, 2015 · 8 comments
Labels

Comments

@paulfalgout
Copy link
Member

DEPRECATION NOTICE Esperanto is no longer under active development.

Now what?

@jamesplease
Copy link
Member

Rollup

@jamesplease jamesplease changed the title Esperanto is deprecated Switch to Rollup Aug 24, 2015
@jamesplease
Copy link
Member

hmmm..maybe actually need to use Babel instead. Not sure if Rollup does any format conversion.

@jamesplease
Copy link
Member

Rollup's API is, perhaps unsurprisingly, very similar to Esperanto's. And until Babel can inline all dependencies I think I'll need to continue relying on outside dependencies to do this. shucks!

@jamesplease jamesplease changed the title Switch to Babel for exporting bundle Move away from Esperanto, as it is deprecated Aug 30, 2015
@kristianmandrup
Copy link

Yeah, WTF!? :O

22:52 $ npm test

> seneca-async@0.0.1 test /Users/kristianmandrup/repos/test123/senaca-projects/seneca-async
> gulp

[DEPRECATION NOTICE] Esperanto is no longer under active development. To convert an ES6 module to another format, consider using Babel (https://babeljs.io)
[22:53:48] Using gulpfile ~/repos/test123/senaca-projects/seneca-async/gulpfile.js
[22:53:48] Starting 'test'...



  0 passing (0ms)

[22:53:48] Finished 'test' after 744 ms

I have all my tests in test/*.test.js with this gulpfile config as provided by https://github.com/babel/generator-babel-boilerplate, modified a tiny bit:

var testFiles = glob.sync('./test/**/*.test.js');

...

function getBundler() {
  // Our browserify bundle is made up of our unit tests, which
  // should individually load up pieces of our application.
  // We also include the browserify setup file.
  var testFiles = glob.sync('./test/**/*.test.js');

Why are no tests run? I have the test/setup/node.js file. What else could be missing? I suspect it is not due to the deprecation warning?

I tried using rollify as per your suggestion

gulp.task('build', ['clean'], function(done) {
  rollup.rollup({
    base: 'src',
    entry: config.entryFileName,
  }).then(function(bundle) {

Looks like the gulpfile fails which is why no tests are run. Are my test file patterns really invalid?
Then I add gulp-print

23:07 $ npm test

> seneca-async@0.0.1 test /Users/kristianmandrup/repos/test123/senaca-projects/seneca-async
> gulp

[23:07:44] Using gulpfile ~/repos/test123/senaca-projects/seneca-async/gulpfile.js
[23:07:44] Starting 'test'...
[gulp] test/setup/node.js
[gulp] test/common.test.js
[gulp] test/debug.test.js
[gulp] test/delegation.test.js
[gulp] test/entity.plugin.test.js
[gulp] test/entity.test.js
[gulp] test/error.test.js
[gulp] test/logging.test.js
[gulp] test/plugin.test.js
[gulp] test/prior.test.js
[gulp] test/seneca.test.js
[gulp] test/seneca.util.test.js
[gulp] test/transport.test.js

  0 passing (0ms)

Looks like some dependency issue, but how do I get gulp test to write the stack trace on an error in a test file? Thanks ;)

Ah yes, coz the tests reference the uncompiled files. However, trying to run npm build and nothing happens. However if i run gulp build directly:

23:30 $ gulp build
[DEPRECATION NOTICE] Esperanto is no longer under active development. To convert an ES6 module to another format, consider using Babel (https://babeljs.io)
[23:30:38] Using gulpfile ~/repos/test123/senaca-projects/seneca-async/gulpfile.js
[23:30:38] Starting 'clean'...
[23:30:38] Finished 'clean' after 4.21 ms
[23:30:38] Starting 'build'...
[DEPRECATION NOTICE] Esperanto is no longer under active development. To bundle ES6 modules, consider using Rollup (https://github.com/rollup/rollup). See https://github.com/rollup/rollup/wiki/Migrating-from-Esperanto for help migrating
[23:30:38] 'build' errored after 2.2 ms
[23:30:38] Error: Could not find entry module (index)
    at /Users/kristianmandrup/repos/test123/senaca-projects/seneca-async/node_modules/esperanto/dist/esperanto.js:1858:10

So what is the story regarding these options? I have an index.js file in root, but I guess that doesn't go in dist on build? in my src, the entry file is seneca.js, hmm...

  "babelBoilerplateOptions": {
    "entryFileName": "index",
    "mainVarName": "seneca",
    "mochaGlobals": [
      "stub",
      "spy",
      "expect"
    ]
  }

Yup, that worked... maybe someone else will find these steps helpful?

$ gulp build
[DEPRECATION NOTICE] Esperanto is no longer under active development. To convert an ES6 module to another format, consider using Babel (https://babeljs.io)
[23:32:16] Using gulpfile ~/repos/test123/senaca-projects/seneca-async/gulpfile.js
[23:32:16] Starting 'clean'...
[23:32:16] Finished 'clean' after 4.3 ms
[23:32:16] Starting 'build'...
[DEPRECATION NOTICE] Esperanto is no longer under active development. To bundle ES6 modules, consider using Rollup (https://github.com/rollup/rollup). See https://github.com/rollup/rollup/wiki/Migrating-from-Esperanto for help migrating
[23:32:17] Finished 'build' after 607 ms

Now do I reference the dist file or the src files from my tests? Neither seems to work for me (note I've been trying to port existing seneca project to babel with async)

https://github.com/kristianmandrup/seneca-async

Cheers!

@jamesplease
Copy link
Member

Hi @kristianmandrup , can you make a separate issue? Thanks!

@kristianmandrup
Copy link

Sorry, was just tired and frustrated last night :P Will do!

@Harris-Miller
Copy link

A heads up: Rollup uses Acornjs for it's js AST. and as far as I can tell, Acornjs does not support ES7 decorators yet. Just trying to use Rollup on it's own throws an error for an unexpected character '@',

I take that back, Esperanto used Acronjs as well, however it was a much older version. Which is what most likely leads to the issue of the ES7 decorators syntax of:

@decorator
class MyClass {
  constructor() {}
}

throwing an error for unexpected character '@'

would be nice to have Acorn begin for on some ES7 syntax using the --ecma7 flag, probably should open up a ticket for that in Acorn's repo

@jamesplease
Copy link
Member

Closing in favor of #230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants