Session by Brigitte Jellinek bjelline
JavaScript has improved. Many New language features were added over the years.
New tools were built. The workflow for frontend projects has changed and become more complex....
Will we only add new stuff, or is it time to drop some old stuff? Old habits, old patters, old tools that we no longer need. Can we simplify the workflow again?
- JavaScript the Language
- Tools
- Browser APIs
In JavaScript everything used to be public and dynamic.
We used closures MDN to keep stuff constant.
function makeProtectedName(name) {
function getName() {
console.log(name);
return name;
}
return getName;
}
const getPassword = makeProtectedName("Secret Name");
getPassword();
const getKey = makeProtectedName("234oiasfas908wjafsd");
getKey();
We now have const and private properties:
const password = "Secret Name";
const key = "234oiasfas908wjafsd";
We used closures and immediately invoced functions - IIF MDN to get private properties and private methods:
we now have classes with private properties and even private methods
use async
and await
.
you will still need Promise.all(), and you will need to understand them.
WARNING: if you code directly in the developer tools, in the console, async await does not work in all cases.
you can use try ... catch ... finally to catch several possible exceptions
- use bun or deno instead of node.js, then you don't need a compile step
- use JSDOC commets as type-annotations, and you can just run JavaScript directly
- use ts-to-jsdoc to convert old typescript to this
- you don't need lodash - https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore?tab=readme-ov-file
- instead of nginx+certbot use caddy
- instead of nvm + rvm + .... use mise to handle all your node versions, ruby versions, python versions, ...
the bundler was invented in a time without proper modules and to concatenate many files into one to improve http performance.
with http2 and http3 loading several files instead of one does not add loading time.
with importmaps MDN your source code can just import bare modules, and specify from where you a loading in a separate importmap.
HTTP3: supported by cadyy,
- FinalizationRegistry helps you react to objects being garbage collected
- AbortController helps with aborting fetches
- terribly HTML and CSS for e-mails caniemail