Giter Site home page Giter Site logo

typescript-project-manager's Introduction

TypeScript-Project-Manager

About

TypeScript project to impliment useage of recently learned TypeScript concepts. TO DO Make TS application that allows user to create, edit, update and delete projects.

Splitting Code into multiple files

Both options provide a clearer way to read and run an application. Recommendation is to use ES Modules because it takes type safety into effect by making sure the code compilers and runs as expected.

Namespaces & File Bundling

Groups code within file folder structure. TypeScript will compile all into one file. Separate files must be named the same for import / export to work. In this project, App was used as the common namespace name. Along with naming conventions, the tsconfig file must be updated to include outFile which tells JavaScript to concatonate namespaces into one single JavaScript file. Also need to update "module" from commonjs to amd. Last update is to HTML file with importing new bundle JavaScript file.

Disadvantages of Namespaces

Compiles without errors even if one of the imports is not imported.

ES 6 Modules / Imports & Exports

Preferred method of utilizing separate files to be compiled into one JavaScript file. Benefit is that user will receive compiling error due to import not being available. Type safety is available when using ES Modules Browsers manage files by each file being compiled into single import. tsconfig file must be updated to module:es2015 and disable outFile. Next replace script source within HTML file back to app.js and remove defer tag. Then add type="module" as attribute to script source.

typescript-project-manager's People

Contributors

jjayjack avatar

Watchers

 avatar

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.