1
0
mirror of https://github.com/flarum/core.git synced 2025-07-12 12:26:23 +02:00

Remove lodash from core (#2827)

* Remove `lodash-es` dependency

* Replace `escapeRegExp` with home-made util

* Replace `throttle` with `throttle-debounce` library

* Use native browser methods for `deepFlatten`

We need a polyfill for iOS 11 and below. I think using a native method with this polyfill is better than having our own function instead, even if the bundle size is ~150B more.

* Save a few bytes in `escapeRegExp`

* Fix typo in comment

* Undo import re-organisation

* Use spread instead of slice

* Use smaller Array.flat polyfill from MDN

* Export new utils in `compat.js`
This commit is contained in:
David Wheatley
2021-05-06 00:28:22 +01:00
committed by GitHub
parent d4a2357a32
commit da5db714c2
10 changed files with 55 additions and 52 deletions

View File

@ -15,8 +15,8 @@ import slidable from '../utils/slidable';
import extractText from '../../common/utils/extractText';
import classList from '../../common/utils/classList';
import DiscussionPage from './DiscussionPage';
import escapeRegExp from '../../common/utils/escapeRegExp';
import { escapeRegExp } from 'lodash-es';
/**
* The `DiscussionListItem` component shows a single discussion in the
* discussion list.