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

Small fixes/cleanup #128

Closed
wants to merge 6 commits into from
Closed

Small fixes/cleanup #128

wants to merge 6 commits into from

Conversation

tkrotoff
Copy link

@tkrotoff tkrotoff commented Sep 15, 2018

  • Git ignore yarn-error.log
  • Remove obsolete test/i18next-parser.config.js => already configured in gulpfile.js
  • Remove unused import => detected thanks to vscode
  • Remove unused i18next-parser.config.js => the root i18next-parser.config.js does not seem to be used
  • Upgrade npm dependencies => use ^ instead ~ + upgrade acorn to latest 5.x (6.x has just been released, acorn-jsx is not yet compatible)

I did not commit dist/ directory to not pollute the diff.



Also, I've found a problem (my original concern) with JSX/TSX fragments (<> ... </>), it fails with error:

1) parser
       parses react files:
     TypeError: baseVisitor[type] is not a function
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.skipThrough (node_modules/acorn/dist/walk.js:183:37)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.base.ScopeExpression (node_modules/acorn/dist/walk.js:298:56)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.base.Function (node_modules/acorn/dist/walk.js:293:3)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.base.FunctionDeclaration (node_modules/acorn/dist/walk.js:271:60)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.skipThrough (node_modules/acorn/dist/walk.js:183:37)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.base.VariableDeclarator (node_modules/acorn/dist/walk.js:282:20)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.base.VariableDeclaration (node_modules/acorn/dist/walk.js:277:5)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.skipThrough (node_modules/acorn/dist/walk.js:183:37)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.base.Program.base.BlockStatement (node_modules/acorn/dist/walk.js:195:5)
      at c (node_modules/acorn/dist/walk.js:29:22)
      at Object.simple (node_modules/acorn/dist/walk.js:31:5)
      at JsxLexer.extract (src/lexers/jsx-lexer.js:45:10)
      at Parser.parse (src/parser.js:68:32)
      at i18nTransform._transform (src/transform.js:70:33)
      at i18nTransform.Transform._read (_stream_transform.js:186:10)
      at i18nTransform.Transform._write (_stream_transform.js:174:12)
      at doWrite (_stream_writable.js:397:12)
      at writeOrBuffer (_stream_writable.js:383:5)
      at i18nTransform.Writable.write (_stream_writable.js:290:11)
      at i18nTransform.Writable.end (_stream_writable.js:563:10)
      at Context.<anonymous> (test/parser.test.js:210:19)

How to reproduce: replace <div> ... </div> with <> ... </> here.

acorn-jsx is supposed to support JSX fragments since 11/2017: acornjs/acorn-jsx#83

Maybe you have more clues

@tkrotoff
Copy link
Author

Travis CI fails with Node 7 because latest fs-extra (v7.0.0) explicitly does not support node 7:

Any reason to explicitly forbid Node v7?
It's already EOLed, and we don't test on it.

I suggest to do the same: support LTS (6, 8, 10) and drop other versions when EOL

@karellm
Copy link
Member

karellm commented Sep 17, 2018

Thanks @tkrotoff but this kind of PR is really tricky to merge. I much prefer many small PRs than one with so many undiscussed changes. Would you mind reopening PRs for each item?

Regarding the i18next-parser.config.js files, they are used for manual testing. I agree that the root one could be removed but not the one inside of tests. Read this for more details: https://github.com/i18next/i18next-parser/blob/master/docs/development.md

@karellm karellm closed this Sep 17, 2018
@tkrotoff
Copy link
Author

PR is really tricky to merge [...] I much prefer many small PRs

Seriously? 5 commits => 3 files deleted and 5+26+2=33 lines of real code changed
I can just drop package.json/yarn.lock commit => I understand this can lead to conflict, for the rest...

@karellm
Copy link
Member

karellm commented Sep 19, 2018

Please don't take this personally or as a refusal for the PR. This is a very common directive for PRs. If I need to argue on this, here are two reasons that apply to this very PR.

1/ Me not wanting to delete i18next-parser.config.js shouldn't have blocked the merge of all the rest.
2/ I try to keep a clean git history and now you've made my job harder unless you rewrite the git history yourself and remove commit 1733620 and force push...

So no it's not a big deal at all indeed, but please in the future when contributing (which I really thank you for), try to address a single things per PR. Now to move forward, if you address my comment, I'll get this merged.

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