Skip to content

Latest commit

 

History

History

you-dont-need

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

You don't need

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

JavaScript the Language

you don't need closures or immediadelty invoced functions

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";

you don't need closures or immediadelty invoced functions

We used closures and immediately invoced functions - IIF MDN to get private properties and private methods:

demo

we now have classes with private properties and even private methods

demo

you don't need callbacks, you often don't need promise.then

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 may not need promise.catch in every case

you can use try ... catch ... finally to catch several possible exceptions

Tools

you don't need a bundler

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,

Browser APIs

you still need ....

  • terribly HTML and CSS for e-mails caniemail