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

feat(): remove deprecated code from older versions #6111

Merged
merged 7 commits into from
Feb 11, 2020

Conversation

asturur
Copy link
Member

@asturur asturur commented Jan 21, 2020

  • removed Object.setShadow, and BaseBrush.setShadow. change rect.setShadow(options) to rect.set('shadow', new fabric.Shadow(options))
  • removed Object.transformMatrix. If you still have transform matrix in your designs look at how fabric removes the transform matrix from svg and preserve visual correctness.
  • removed object:selected event. use selection:created. In the callback you will still find target in the options, but also you will find selected with all the objects selected during that single event.
  • removed Gradient.forObject. It wasn't that helpful. The new gradient options introduced in 3.4.0 make up for the missing method.
  • removed Object and canvas clipTo. Use Object.clipPath;
  • removed Canvas.loadFromDatalessJSON, it was just an alias for loadFromJSON
  • removed observe, stopObserving, trigger from observable. Keep using on, off, fire.
  • removed the Object.set ability to take a function as a value. Was rather strange to use.
  • removed Object.setGradient. Change rect.setGradient(options) with rect.set('fill', new fabric.Gradient(otherOptions)). The options format is slightly different, but keeping 2 formats does not really make sense.
  • removed Object.setPatternFill. Change rect.setPatternFill(options) to rect.set('fill', new fabric.Pattern(options));
  • removed Object.setColor. Change rect.setColor(color) to rect.set('fill', color)
  • removed fabric.util.customTransformMatrix. Use the replacement fabric.util.composeMatrix

@stale
Copy link

stale bot commented Feb 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Feb 4, 2020
@stale stale bot removed the stale Issue marked as stale by the stale bot label Feb 9, 2020
@asturur asturur merged commit ccf90d9 into master Feb 11, 2020
@asturur asturur deleted the removed-deprecated-code branch March 9, 2020 00:19
@juzhiyuan
Copy link
Contributor

Hi @asturur , I think this wiki page[1] is out of date, such as object:selected event was changed to selection:created, how about removing it or added some tip[2] on it?

[1] https://github.com/fabricjs/fabric.js/wiki/Working-with-events
[2] http://fabricjs.com/v2-breaking-changes-2

@asturur
Copy link
Member Author

asturur commented May 30, 2020

That is a breaking change for v4.
I think i should remove the wiki pages, since i already have problem mantaining the fabricjs.com doc website.

@juzhiyuan
Copy link
Contributor

Agreed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants