Giter Club home page Giter Club logo

Comments (4)

asturur avatar asturur commented on July 4, 2024

hi @Serene47 you can look at the fabricjs repo and a jsdoc there if missing

from fabricjs.com.

Serene47 avatar Serene47 commented on July 4, 2024

hi @asturur, Yeah I am fine with js doc,

But my point is people who are new with fabric js, assume util.object.clone for cloning fabric objects, use it and break their code at some point.

Some posts justifying my point

I also ran into that kind of problem and had to put some effort to find the repo and look into it.

I assume if we provide documentation on the official page, people are more likely to read that.

from fabricjs.com.

asturur avatar asturur commented on July 4, 2024

I have nothing against an explanation of that jsdoc on the website. But how would you frame it?
the only place i can think of is the fabricjs-gotchas.

This is what we say in the fabricJS docs for extend:

  /**
   * Copies all enumerable properties of one js object to another
   * this does not and cannot compete with generic utils.
   * Does not clone or extend fabric.Object subclasses.
   * This is mostly for internal use and has extra handling for fabricJS objects
   * it skips the canvas and group properties in deep cloning.
   * @memberOf fabric.util.object
   * @param {Object} destination Where to copy to
   * @param {Object} source Where to copy from
   * @return {Object}
   */

and this is what we say for clone:

  /**
   * Creates an empty object and copies all enumerable properties of another object to it
   * @memberOf fabric.util.object
   * TODO: this function return an empty object if you try to clone null
   * @param {Object} object Object to clone
   * @return {Object}
   */

Now the main issue is that the clone jsdoc needs to be updated with the content of the extend one.
That is 100% useful and quick to do. If you want to add a specific part in the docs, make a proposal with a PR on this repo.

from fabricjs.com.

Serene47 avatar Serene47 commented on July 4, 2024

Hi, thanks for your suggestion

I have added pull requests in fabricjs/fabric.js and fabricjs/fabricjs.com

from fabricjs.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.