-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nodejs Project Management #2757
Comments
I must say that this also pisses me off. I recommend the TypeScript team implement something like |
@thetutlage you are looking to bundle all your outputs in one module, e.g. models.js (include both user.ts and likes.ts)? |
@mhegazy Does it really make sense to bundle server code into one file ? |
then i did not understand your proposal/request. can you elaborate? |
Sure , it is easy on client side to make easy of Typescript as i can easily bundle my entire code into 1 file. But on server it is a problem as i will have a project structure which is not manageable according to me. So i was keen to know is there any best practice one can follow when using Typescript on Server ( with Node js ). So in short the question is only related to code base management. |
I do not think i have "best practices" to share per se. we use --out for the compiler code base, and emit only one file for our node package (see https://github.com/Microsoft/TypeScript/blob/master/bin/typescript.js). In general I think bundling is similar on the server/client (in other words CommonJS/AMD). The same issue persists, you want as a developer to have a many files that represent your component, but want to hide this from your users by distributing a single file representing your component. I think if we end up doing bundling it will work for both AMD and CommonJS. |
Okay cool , it makes sense . I was just wondering may be there is a 3rd way. |
@thetutlage I am doing the following, using gulp building.
|
Looks like there is no more information needed for this issue. closing. |
To me Typescript seems to be a better choice for writing code where the code base is huge and requires more consistency.
But the examples and experiences i find around the internet are more on client side , may be coz of the Angular2.0 decision to use AtScript/Typescript.
Though Typescript adds a lot of power to Javascript , there is something that keeps on pissing me off is how to manage codebase with duplicate files. According to my understanding i can have 2 ways to do it.
1st Way
Use a build tool like gulp/grunt , watch for changes and compile Typescript to Javascript in the same folder. which may look something like this.
2nd Way
Another way will be the same but of instead of outputting Javascript into the same folder , i can clone the entire workspace.
Where both are not the best solution for me , is there any other way to manage codebase for nodejs. For client it is simple as we have only one output file.
The text was updated successfully, but these errors were encountered: