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

Modernise codebase (big WIP) #2140

Closed
wants to merge 8 commits into from
Closed

Modernise codebase (big WIP) #2140

wants to merge 8 commits into from

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented May 26, 2020

This is something I've been chipping away at. Only about half done at the moment but I thought I should push it in case I forget about it and someone else wants to pick it up and to collect intermediate feedback on my approach if anyone wants to weigh in.

The aim here is to embrace modern JS, >= Node 10 style. So primarily async / await and the various pieces of syntactic sugar that we haven't yet embraced here (template strings, arrow functions, no more var, etc.). Secondarily is to clean up the style a bit to make it more clear and get rid of the huge nesting that's been piling up since the original code and make it more maintainable in the process. In the process I'd like to expose more of the code for testing, so it'll probably meaning splitting out more files that are focused on just one thing that can be isolated and tested.

test/ should all be done I think, lib/ is where the bulk of the remaining work is.

There's a couple of places where new Promise() appears in this WIP code that will eventually be factored out, they're just used as bridging points between callback and async/await style so the tests still pass. In the end I think the only place explicit new Promise() will appear is around child_process work which is still hard to promisify nicely, but I think that should probably all be factored out into a single place to avoid the duplication.

@rvagg rvagg mentioned this pull request Sep 14, 2020
3 tasks
@rvagg rvagg mentioned this pull request Nov 3, 2020
3 tasks
@rvagg rvagg closed this Jun 24, 2021
@lukekarrys lukekarrys deleted the rvagg/modernise branch March 8, 2024 23:03
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.

1 participant