Comments (9)
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.
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.
@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.
@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.
@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.
@Gmousse Can you propagate these changes to the lib directory so I can be more confident in testing?
from dataframe-js.
@Gmousse Can you merge the PR?
from dataframe-js.
@Jefftopia Uh sorry I was really busy (and I forgot this PR :D).
It will be effective today.
from dataframe-js.
Merged in 1.2.5 (published).
Thanks for your issue. Have fun
from dataframe-js.
Related Issues (20)
- [BUG] fromCSV fails when there is a space in the path HOT 1
- [BUG] TypeError: Cannot read property 'toStringTag' of undefined HOT 3
- has the csv file been loaded successfully? HOT 1
- .push does not seem to work HOT 1
- add index to the DataFrame
- keep date as a type of data in DataFrame-js
- [BUG] Inconsistent left join results
- [QUESTION] Why does the aggregate function drops all columns ? HOT 2
- [BUG] Dataframe loaded from file doesn't identify missing values
- [BUG] Creating new DataFrame from array with duplicate column names
- [BUG] Typo in the documentation
- [FEATURE] - To be able to filter a DataFrame from a MongoDB JSON export by Object ID
- [BUG] Filtering is not working as expected HOT 1
- Documentation not available[BUG]
- [BUG]
- [BUG] DataFrame is not a constructor HOT 3
- [BUG] Definitions for filter and where functions missing boolean option
- [FEATURE] Improve error messages
- [BUG] Documentation page returning 401 unauthorized
- [BUG] Documentation showing wrong syntax for SQL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataframe-js.