Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
javascript
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 May 2017 at 09:15 UTC
Updated:
20 Jul 2017 at 06:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nod_Comment #3
nod_Comment #4
droplet commentedThank GOD. Then, it's reviewable :)
I haven't really dive into the review. Will ESLint convert the code this way? ( Provided by Airbnb? )
Any way to ask CORE Committers feedback before patch review. Not sure if they accept big patch or not.
Comment #5
nod_Yes eslint added that, running the current
lint:core-jsis the only thing I did.Changes to the .js files only to help reviewing
Comment #7
droplet commentedDon't you believe or not. I scaned line-by-line :p. It's verrrrrry simple changes.
the failture on this test file:
the point I mentioned on #4
https://github.com/airbnb/javascript#functions--spread-vs-apply
RTBC if you fix the test case
Comment #8
nod_I removed locale_test.es6.js altogether and left locale_test.js as it was before the rename.
Comment #9
nod_Comment #10
droplet commentedMy first check, the patch looks okay.
These 2 commands will help you to review:
Needs a follow-up to ignore it or other treatment, right?
Comment #11
nod_I think we should leave it like that. Now that the .js files are generated there won't be strange formats of Drupal.t() in js files (in core at least).
We should do something when the code is changed to look for translations in ES6 files and not .js files. Until then going with only the js file is fine for me. If we introduce a es6 file for this one, the generated result doesn't help testing what needs to be tested at all.
Comment #12
droplet commentedHmm.. make sense.
Guessing we need to file an issue soon to handle template literal. (PHP using regex to match it I bet)
Ideally, before we remove the older browser supports:
http://kangax.github.io/compat-table/es6/#test-template_literals
Comment #13
droplet commentedNow, the patch looks good. I will do my 2nd review this weekend.
Comment #14
droplet commentedAfter some more thoughts and review & tests. I think I will mark it as RTBC.
Needs a final rerolls.
Comment #15
GrandmaGlassesRopeMan@droplet @nod_
I just ran this against the latest
HEAD,c122124367. 👍✖ 1288 problems (528 errors, 760 warnings)Comment #17
GrandmaGlassesRopeMan- Minor issue with escaped strings.
Comment #18
droplet commentedThanks for the reroll @drpal, so I can review it again :)
We have to ignore this file completely to let the tests to catch the SINGLE / DOUBLE QUOTE bugs. (@see #8)
Comment #19
GrandmaGlassesRopeMan@droplet
Ah yes. Thanks for pointing that out. 👍
Comment #21
GrandmaGlassesRopeManSorry; I should have run that test locally before uploading. 🤔
Comment #22
droplet commented🚀🚀🚀🚀🚀🚀
Comment #24
GrandmaGlassesRopeManComment #25
GrandmaGlassesRopeMan- rerolled at
950362eb48.Comment #26
droplet commentedMissing the JS files
Comment #27
GrandmaGlassesRopeMan@droplet 👍
Comment #28
droplet commented🚀🚀🚀🚀🚀🚀
Comment #29
droplet commentedComment #31
droplet commentedMake life easier
Comment #32
GrandmaGlassesRopeManMaybe this time? 🙅
Comment #33
lauriiiOur pre-commit hooks would actually prevent committing this so I suggest we try to find another solution for #8.
Comment #34
droplet commentedAFAIK, Babel has no ignores syntax. Let's make the pre-commit hooks compatible with CORE. It's not worth to change the build script or introduce a pattern to our developers to handle this one exception. and may be the only one forever.
Comment #35
lauriiiCouldn't we add an eslint ignore to that file, so that the auto fix wouldn't make changes to the file?
Comment #36
droplet commentedI wish we can. The change comes from Babel rather than ESLint fix. To check out the unpatched you will have a clear overview :p
Comment #37
lauriiiThanks @droplet. I was first only looking at the failing tests, and noticed that the only test breaking changes come from eslint. Now that I dug a bit deeper it looks like we don't want babel to compile this since this it needed for the locale module regex tests. It seems like not having .es6 version of this file is the accurate thing to do.
I think we should add a comment to the file why this is the case since at least for me this wasn't obvious at first. Probably updating the file documentation to point out to the correct file would be a good start.
In the meanwhile, I will try to figure out what would be the best way to make the git hooks support this exception.
Comment #38
droplet commentedOK. I leave it for someone able to write a better comment :p
This line blocking the commit I think:
https://github.com/alexpott/d8githooks/blob/master/pre-commit-8-4#L127
Comment #39
droplet commentedAlso, maybe we should do it (#37) in a new issue thread and don't mess with the big patch together. It's easier to review/rerolls.
EDIT:
OK. I've done it: #2889600: [regression] Restore \LocaleJavascriptTranslationTest test coverage and keep testing processed JS file
Comment #40
droplet commentedI think we able to skip the local_test in this patch. Auto-fix ESLint doesn't fix all issues.
Comment #41
GrandmaGlassesRopeManComment #42
GrandmaGlassesRopeManI'm postponing this until we get a resolution on #2889600: [regression] Restore \LocaleJavascriptTranslationTest test coverage and keep testing processed JS file.
Comment #43
droplet commentedWhy not commit it straightly? I removed the local_test change in #40.
ESLint on d.org is broken now, I think we will have 2 round or 3 autofix.
This issue will unlock manual code refactoring to ES6 standard I think. (Pretty a lot of work still)
Comment #44
GrandmaGlassesRopeMan@droplet
Yep. This is blocking all progress on the manual code refactoring. I didn't notice that you'd removed the changes in #40, it's pretty hard to review this huge patch. We can figure out how to handle the
locale_test.jsregressions later.Comment #45
lauriiiI did a couple of things to review the patch:
./node_modules/.bin/eslint --fix . || true && yarn build:jsand confirmed that only differences were that the patch from #40 has reverted changes to local_test. I agree that we should handle that in separated issue.Committed 612c1fa and pushed to 8.4.x. Thanks!