requirejs - typescript - 250 .ts files - require(), //reference, module, etc -
we creating typescript app have 250 classes. coming c# world, creating .ts file each class. , feels appropriate each class/file between 20 , 500 lines of code. , keeps things clean object orientation.
which leads couple of questions this.
- should have unique module name per .ts file, per folder, or per project (a folder , sub folders)?
- when class dependent on other classes, should wrap .ts file in require/define (we use require.js) dependencies? or should have single massive require in our root .js file (listing 250+ files)? or there approach should use?
- we having put in ton of /// <reference ... /> statements. there way have global ones? or way put wild cards in can have single reference call .ts files in folder?
- any other suggestions should , should not project large?
update: client side app run in browser. presently using requirejs. lot of code, of code needed in browser (sooner or later).
i want quick/easy run/debug when coding , then, building differently, have fast/small upload. half of develop in webstorm , half in visualstudio.
should have unique module name per .ts file
yes use amd/commonjs : https://www.youtube.com/watch?v=kdrwlmuy0r0&hd=1
per folder
yes create index.js exports folder.
when class dependent on other classes, should wrap .ts file in require/define (we use require.js) dependencies?
no. use built in import statement in typescript
we having put in ton of /// statements. there way have global ones?
yes @ reference files https://github.com/grunt-ts/grunt-ts#reference-file-generation
any other suggestions should , should not project large?
depend on typescript as can , refactoring different pattern not hard when 1 emerges (you should compile errors)
Comments
Post a Comment