Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

[JS] Code refactoring #141

Open
ElectricMaxxx opened this issue Feb 11, 2017 · 1 comment
Open

[JS] Code refactoring #141

ElectricMaxxx opened this issue Feb 11, 2017 · 1 comment
Milestone

Comments

@ElectricMaxxx
Copy link
Member

For a better working with the javascript code i would suggest some refactorings.

More files

As we concat the complete code into one file it wouldn't be that problem to divide the code into more files. So i would suggest some little services for each callback we put into the options object of fancytree. Doing so we can handle each part separate and could unit test most of them (mostly we do transformations on data.node)

type hinting

As fancytree has a feature rich api and we transport a specific model through our api i would suggest to use some kind of typehinting. In typescript i use (DefinitelyTyped)[https://github.com/DefinitelyTyped/DefinitelyTyped] no clue if ES6 has something equalt, but would be a reason for me to move into typescript (at the end it is an other converter only)

@wouterj
Copy link
Member

wouterj commented Feb 11, 2017

As we concat the complete code into one file it wouldn't be that problem to divide the code into more files. So i would suggest some little services for each callback we put into the options object of fancytree. Doing so we can handle each part separate and could unit test most of them (mostly we do transformations on data.node)

Not sure how exactly, but definitely +1 on making the files a bit less big (and thus more structured).

As fancytree has a feature rich api and we transport a specific model through our api i would suggest to use some kind of typehinting. In typescript i use (DefinitelyTyped)[https://github.com/DefinitelyTyped/DefinitelyTyped] no clue if ES6 has something equalt, but would be a reason for me to move into typescript (at the end it is an other converter only)

Not sure about this one. One thing I know, if we're going to switch to typescript, I'll stop contributing to the JS code in this bundle ;)

@wouterj wouterj added this to the 2.1 milestone Feb 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants