Skip to content

Commit

Permalink
Switch to lodash-es for small bundle size (#3910)
Browse files Browse the repository at this point in the history
  • Loading branch information
fnlctrl authored Nov 20, 2023
1 parent 0592f02 commit be0306e
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 68 deletions.
4 changes: 1 addition & 3 deletions core/editor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import cloneDeep from 'lodash.clonedeep';
import isEqual from 'lodash.isequal';
import merge from 'lodash.merge';
import { cloneDeep, isEqual, merge } from 'lodash-es';
import { LeafBlot, EmbedBlot, Scope, ParentBlot } from 'parchment';
import type { Blot } from 'parchment';
import Delta, { AttributeMap, Op } from 'quill-delta';
Expand Down
3 changes: 1 addition & 2 deletions core/quill.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cloneDeep from 'lodash.clonedeep';
import merge from 'lodash.merge';
import { cloneDeep, merge } from 'lodash-es';
import * as Parchment from 'parchment';
import type { Op } from 'quill-delta';
import Delta from 'quill-delta';
Expand Down
3 changes: 1 addition & 2 deletions core/selection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { LeafBlot, Scope } from 'parchment';
import cloneDeep from 'lodash.clonedeep';
import isEqual from 'lodash.isequal';
import { cloneDeep, isEqual } from 'lodash-es';
import Emitter from './emitter';
import type { EmitterSource } from './emitter';
import logger from './logger';
Expand Down
3 changes: 1 addition & 2 deletions modules/keyboard.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cloneDeep from 'lodash.clonedeep';
import isEqual from 'lodash.isequal';
import { cloneDeep, isEqual } from 'lodash-es';
import Delta, { AttributeMap } from 'quill-delta';
import { EmbedBlot, Scope, TextBlot } from 'parchment';
import type { Blot, BlockBlot } from 'parchment';
Expand Down
72 changes: 22 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
],
"dependencies": {
"eventemitter3": "^4.0.7",
"lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.5.0",
"lodash.merge": "^4.5.0",
"parchment": "^3.0.0-alpha.1",
"quill-delta": "^5.1.0"
},
Expand All @@ -28,9 +25,7 @@
"@babel/preset-env": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@playwright/test": "^1.39.0",
"@types/lodash.clonedeep": "^4.5.7",
"@types/lodash.isequal": "^4.5.6",
"@types/lodash.merge": "^4.6.7",
"@types/lodash-es": "^4.17.11",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@vitest/browser": "^0.34.6",
Expand All @@ -48,6 +43,7 @@
"http-proxy": "^1.18.0",
"jsdom": "^22.1.0",
"lodash": "^4.17.15",
"lodash-es": "^4.17.21",
"mini-css-extract-plugin": "^2.7.6",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion themes/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import merge from 'lodash.merge';
import { merge } from 'lodash-es';
import type Quill from '../core/quill';
import Emitter from '../core/emitter';
import Theme from '../core/theme';
Expand Down
2 changes: 1 addition & 1 deletion themes/bubble.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import merge from 'lodash.merge';
import { merge } from 'lodash-es';
import Emitter from '../core/emitter';
import BaseTheme, { BaseTooltip } from './base';
import { Range } from '../core/selection';
Expand Down
2 changes: 1 addition & 1 deletion themes/snow.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import merge from 'lodash.merge';
import { merge } from 'lodash-es';
import Emitter from '../core/emitter';
import BaseTheme, { BaseTooltip } from './base';
import LinkBlot from '../formats/link';
Expand Down

0 comments on commit be0306e

Please sign in to comment.