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

BREAKING: extend, clone => internal cloneDeep #8600

Merged
merged 28 commits into from
Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ change-output.md
before_commit
/coverage/
.idea/
/dist/fabric.require.js
/dist/fabric.min.js.gz
/dist/
/cli_output/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [next]

- chore(): replace `clone(obj, true)` with `cloneDeep(obj)` and remove all `extend`, `clone` calls in favor of object spreads. [#8600](https://github.com/fabricjs/fabric.js/pull/8600)
BREAKING:
`clone` and `extend` are used in all examples unfortunately so the community must have adopted them.
Devs using `extend` on classes should mutate the prototype directly (or with `defineProperty`) or subclass.
Using `clone` or `extend` to assign to an object was always a bad idea. Use lodash or whatever.
- chore(TS): remove all remaining empty declarations [#8593](https://github.com/fabricjs/fabric.js/pull/8593)
- refactor(IText): modernize IText cursor animation based on animation API changes (and fix minor regression) plus leftovers from #8547 [#8583](https://github.com/fabricjs/fabric.js/pull/8583)
- refactor(Canvas, IText): Handle cross instance text editing states to an EditingManager class [#8543](https://github.com/fabricjs/fabric.js/pull/8543)
Expand Down
5 changes: 0 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ import {
stylesToArray,
hasStyleChanged,
} from './src/util/misc/textStyles';
import { clone, extend } from './src/util/lang_object';
import {
createCanvasElement,
createImage,
Expand Down Expand Up @@ -194,10 +193,6 @@ const util = {
stylesToArray,
hasStyleChanged,
getElementOffset,
object: {
clone,
extend,
},
createCanvasElement,
createImage,
copyCanvasElement,
Expand Down
Loading