Update decisions doc

This commit is contained in:
Merijn Hendriks 2021-12-29 16:52:37 +01:00
parent ac23689342
commit 0a1d92f109

View File

@ -1,35 +1,45 @@
# Decisions
A small document highlighting why certain choices were made.
## Server
## Typescript
### Tools
- static typing
- stricter than normal javascript
- better visual studio code support than javascript
- typescript
- static typing
- stricter than normal javascript
- better visual studio (code) support
- drawio
- lighter than png diagrams
- allows for editing the diagrams later
## Babel
### Conventions
- polyfill es6 modules to commonjs
- hooks in better sourcemap support for node
- file naming
- emulate C# namespacing
## Browserify
### Libraries
- required for nexe bundling (has a bug where bundling source fails)
- fixes the `Uncaught ReferenceError: exports is not defined` error
- far easier to setup compared to webpack
- browserify
- less setup compared to webpack
- node:http
- no additional dependencies
- no overhead from frameworks
- can be modified to the project's specific needs (EFT request have no compression headers, but data is zlib compressed)
- rcedit
- no virus warning after editing the target exe
- ws
- no overhead from frameworks
- no additional dependencies client side
- typescript-eslint
- provides type-specific rules for typescript as well opposed to alternatives
## Node.http
### Build
- can be modified to our specific needs
- no additional dependencies, overhead and complexity under the hood compared to frameworks
- eft requires special care in request/response handling (no compression headers, but data is zlib compressed)
- `npm run build` is reserved by VS2022 for it's build task
- nexe cannot include `node_modules` of it's own, so browserify is used to combine it all into one JS file
- browserify doesn't support ES6 modules, so babel is used for transpiling to CommonJS.
- node doesn't include sourcemaps loading support, so we add it in through a babel plugin (`babel-plugin-source-map-support`)
## File naming
### Lint
- emulates C# namespacing, which I prefer
## Drawio
- png diagrams are heavy, drawio diagrams are not
- allows for editing the diagrams later
- marked `any` explicitly valid to allow for prototyping faster