-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Manually Decaf tabs
package Specs
#357
Manually Decaf tabs
package Specs
#357
Conversation
Alright @pulsar-edit/core this PR is good to review, all tests are passing without issue, matching the amount of tests we would expect. It may be worth noting that we do have on unexpected failure of tests the |
Alright quick update. Further reviewed the tests, since there were some unexpected failures, but seemed to be related to like mentioned above the RipGrep download. But that isn't totally the case. Going off of our current expected failure rate here's what we have for this PR's tests currently:
So while outside the scope of this original PR I'll take a look at ensuring we have a proper amount of passing tests. |
Alright, with one small change to the test runner we now have expected failure rates.
It's worth noting for |
Oof, I spent 20 minutes decaffeinating I'll wait until this lands on master before opening my PR. |
Sorry to hear we doubled up on work, but glad to see a fix is in for that! Super awesome, and good point to mention, anyone from @pulsar-edit/core wanna take a look? Or considering the scope and the fact that all tests are passing should we be good to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the tests still pass with this, both for me locally and I observe it passes in CI also.
Shouldn't make a difference, but just in case: I also loaded the package from this branch into my editor, using ppm install
and ppm link
in the packages/tabs
dir, and reloaded my editor. Tabs still work as expected. (Which makes sense... this PR or its base branch don't modify the source code after all...)
More thoughts:
I have some minor things I notice with usage of undefined
vs null
that I wonder about, however this stuff is all internally used in the packages/tabs tests only, so certain details don't matter, this does not run in production, and we practically speaking will never receive unexpected inputs. (All inputs are stably defined in the test files, to the extent changes in the rest of the editor don't invalidate the current test logic, I suppose.)
I implicitly trust these efforts, and can apply somewhat less scrutiny by default since it is passing. (Although at some risk of "false pass" test cases if the logic turns out to have been incorrectly translated to clean JS?) If it makes sense to, I can apply more scrutiny than I have, and do more rounds of review feedback, but I feel from a quick look that it is okay.
(These decaf PRs are going to take a very long time to earnestly and fully review, I think? So I am honestly not looking over every line in fine detail. Let me know if you want my thoughts on the defined
vs null
stuff, but I am aware this would take lots more time for back-and-forth, and may not be worth it. It's a real trade-off, IMO, so I would go either way with it.)
UPDATE: I think I spotted a tiny (one character) genuine mistake (albeit one with no apparent impact, since I think this function's inputs are defined in this file and I don't think they're ever undefined
or null
). I proposed a fix in a suggested diff below.
Co-authored-by: DeeDeeG <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR was technically fine before my round of review, now review comments are addressed, double-approved, two thumbs up, 👍 👍 shipit ™️ 🚀
Edit to add: FWIW I tried my best to read through all the 634 +/- changes to tabs-spec.js
and nothing jumped out at me as needing comment. Just removing presumably unneeded return
statements, converting function () {}
to arrow functions () =>
. Which looks all good to me. Nice!
Nothing left to look at, so the whole thing LGTM.
@DeeDeeG Appreciate the review! I'll go ahead and merge this one |
@confused-Techie: apologies for making this about my fix for #349, but what's the timetable for merging |
No worries, the proper branch has already been merged into master in #367 I intended to change the target branch here after review, but had forgotten todo so |
In this PR I've removed the last CoffeeScript remaining in the
tabs
package. Which were the specs.The main portion of this PR is rather simple. Removing useless
return
s and switching to a more modern style by removing inline anonymous function declarations and instead using arrow functions.Otherwise the most complex part relates to the
event-helper
files, which contain the details below:The spec files here originally had
event-helper.js
andevent-helper.coffee
so it was difficult to tell which was more up to date.And seems they were both still in use. With the following line being at the top of
tabs-spec.coffee
Then this wasn't as simple as decafing
event-helpers.coffee
since it seems thebuildDragEnterLeaveEvents
only existing in the JS, and relied on an internal function to both specs files that had different implementations between each.So I've used machine decaf on
event-helpers.coffee
and added the functionbuildDragEnterLeaveEvents
into the decaffed code, copied directly from the existing JS.From there
buildMouseEvent
was the function that existed in both specs but differred slightly between the two. So this had to be rewritten to support both the usage fromevent-helpers.coffee
andevent-helpers.js
but otherwise looks fine, with all tests passing locally.Again if this PR is accepted then it'll be merged directly to main, rather the the machine decaf branch that it currently targets for ease of review.