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

Cleanup code: native promises, async/await, remove lodash etc #7171

Open
richarddd opened this issue Jan 3, 2020 · 1 comment
Open

Cleanup code: native promises, async/await, remove lodash etc #7171

richarddd opened this issue Jan 3, 2020 · 1 comment
Labels

Comments

@richarddd
Copy link
Contributor

@richarddd richarddd commented Jan 3, 2020

Feature Proposal

Well, this a rather big one and should be done in steps and with caution, preferably one file at the time.

I have been working with the framework for some time now and when you start digging into the core there are a lot of "old-ways" of doing stuff.

IMO we would drastically improve code quality, increase readability, allow for better productivity and potentially introduce fewer bugs if we're to apply these changes to the framework:

Description

  • Use native promises
  • Use async/await to avoid promise hell
  • Remove lodash (if some specific lodash funciton is required, it should be added as a specific dependency, but we should replace _.merge, _.forEach, _.includes, _.mapKeys etc with native node functions)

Similar or dependent issues:

@medikoo

This comment has been minimized.

Copy link
Member

@medikoo medikoo commented Jan 7, 2020

@richarddd great thanks for putting light on that.

Use async/await to avoid promise hell

We're aware of that issue, and want to do that shift soon. Still it'll require drop of support for Node.js v6+, and that's technically breaking semver wise, so we hold it until v2.0.0 release.

Use native promises

This best if done with async/await (otherwise it's doubled effort)

Remove lodash

We can do that now. I would start by replacing those that can be easily fill in by native counterparts (as _.forEach, _.includes etc.). PR is welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.