Giter Club home page Giter Club logo

Comments (9)

Gmousse avatar Gmousse commented on August 17, 2024 2

The checkTypes decorator is nifty, but do we really need run-time type checking?

No. I m agree, it's not required. I will see to replace it in a next version. (It was planned but I had fixed this issue with keep-fnames due to a lack of personal time). I will try to see how to resolve this issue this week-end.

Uglify has a mangle options object

Oh, thanks for the trick. I will use it for my next projects. However, it will be useless to use this option if I remove checkTypes decorators (my main option here).

Thanks for the discussion, stay tuned for the fix (I will give you the feature branch for a feedback in the next 7 days).

from dataframe-js.

Gmousse avatar Gmousse commented on August 17, 2024

Hi @Jefftopia,
Indeed keep-fnames was a bit tricky and was added to keep checktypes decorators working with user defined types.
I suggest to remove keep-fnames and try to find an alternative (other library) to these checkTypes decorators (or just remove them if NODE_ENV=production).

However, to check the identity of an instance (DataFrame vs GroupedDataFrame), it's possible to use:
(new DataFrame()) instanceof DataFrame
(new DataFrame()).constructor == DataFrame

Is that what you are looking for?

from dataframe-js.

Jefftopia avatar Jefftopia commented on August 17, 2024

@Gmousse Thank you for the tip and for acknowledging interest in enhancing the developer experience here.

I have a couple thoughts.

First, The checkTypes decorator is nifty, but do we really need run-time type checking? I think that for javascript either the developer should know the API, which you've documented, or, we should simply create a TypeScript definition file. I develop in TS and would find this valuable regardless of the decorator.

I 100% agree with this statement:

just remove them if NODE_ENV=production

Second, I discovered that Uglify has a mangle options object that allows you to mangle everything except specified class names.

I'm using below, which mangles all except DataFrame and GroupedDataFrame, which resolves my issue.

    new UglifyJsPlugin({
      "uglifyOptions": {
        "mangle": {
          "reserved": ["DataFrame", "GroupedDataFrame"]
        }
    }),

from dataframe-js.

Gmousse avatar Gmousse commented on August 17, 2024

@Jefftopia Be free to test if keepfname is no longer a problem on the linked pr.

I will integrate the code in a larger feature in some days.

I have kept some run-time type checking on tested functions but I will see if I kept them.

from dataframe-js.

Jefftopia avatar Jefftopia commented on August 17, 2024

@Gmousse I will try to look over this soon, tonight or tomorrow. Busy holiday week in the US (Thanksgiving). Thank you. It looks good.

from dataframe-js.

Jefftopia avatar Jefftopia commented on August 17, 2024

@Gmousse Can you propagate these changes to the lib directory so I can be more confident in testing?

from dataframe-js.

Jefftopia avatar Jefftopia commented on August 17, 2024

@Gmousse Can you merge the PR?

from dataframe-js.

Gmousse avatar Gmousse commented on August 17, 2024

@Jefftopia Uh sorry I was really busy (and I forgot this PR :D).
It will be effective today.

from dataframe-js.

Gmousse avatar Gmousse commented on August 17, 2024

Merged in 1.2.5 (published).
Thanks for your issue. Have fun

from dataframe-js.

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.