FEATURE: Remove lodash usage and deprecate it. (PR #10566)

This removes lodash usage. Most uses are not useful but some might be worth keeping around. In that case it should be a model.

GitHub

Careful on that one:

Uploading Screenshot 2020-09-01 at 09.05.29.png…

Reading this, it seems like you are aware of the difference between the two isEmpty

the only thing first does is working with null/undefined.

_.first(null) // undefined

So I guess codepaths replacing _.first should ensure the object is not null/undefined.

We might also want to remove these functions from https://github.com/discourse/discourse/blob/master/lib/tasks/javascript.rake#L223

Probably with a deprecation.

There are some plugin uses like https://github.com/discourse/discourse-patreon/blob/master/assets/javascripts/discourse/controllers/admin-plugins-patreon.js.es6#L14

The title of this pull request changed from “Move lodash to model or remove it” to "FEATURE: Remove lodash usage and deprecate it.

I believe I accounted for this. All tests are passing.

@xfalcox yes I am aware. The PR was still in draft and I hadn’t finished at that point.

It now removes all lodash usage in our codebase and deprecates it for plugins/themes to continue working until we update their code too. I’ve slated it for removal in 2.7.

Rspec failure seems unrelated.