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

Extraction from JS ES6 files does not work and no debug messages #140

Closed
jehy opened this issue May 6, 2016 · 5 comments
Closed

Extraction from JS ES6 files does not work and no debug messages #140

jehy opened this issue May 6, 2016 · 5 comments

Comments

@jehy
Copy link

jehy commented May 6, 2016

Please disregard this message and look at the following one.

@jehy
Copy link
Author

jehy commented May 11, 2016

Okay, I found the culprit. Anuglar-gettext-tools don't work with javascript ES6.
We had a piece of code:

      async function loadTypes() {
          if ($rootScope.dashboard.types) return;

          const { categories } = await Api.offerTypes();
          $rootScope.dashboard.types = categories;
      }

And extraction task siliently died on async function.

I request compatibility with ES6 and printing some debug info - to know that files could not be translated due to some error.

Right now we are going to use babel to downgrade our javascript to processable version.

@jehy
Copy link
Author

jehy commented May 11, 2016

I think that those two commits will be helpful:

bartbutler@2420853
bartbutler@de9281d

@jehy jehy changed the title Extraction from JS file does not work Extraction from JS ES6 files does not work and no debug messages May 11, 2016
@gabegorelick
Copy link
Collaborator

gabegorelick commented May 21, 2016

There are 2 issues here:

  1. We need to provide feedback when parsing fails, and not just silently swallow parser errors.
  2. We need to upgrade the espree options to support whatever is failing

@gabegorelick
Copy link
Collaborator

It's failing on the async/await, which is not part of ES6/ES2015, but is slated for ES7. espree doesn't support it [1] so there's probably nothing we can do. When async/await is standardized, it will be added to espree, and we should support it without any changes. Until then, use a transpiler like babel before calling angular-gettext.

[1] eslint/js#140

@gabegorelick
Copy link
Collaborator

Also, the lack of error message will be fixed when #143 lands. Thanks for reporting this.

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

No branches or pull requests

2 participants