It is interesting as it avoids a typescript to javascript compilation.
It works with plain JS too.
How an array was built before Ecmascript v1
A Jupyter notebook demo style for JS.
blog-cells can turn any web page into an interactive code notebook, similar to Jupyter notebooks, but powered by JavaScript and running entirely in the browser.
There's no server-side component, so you can share your notebooks on static site hosts like GitHub pages. Check out the source for this page here.
Check it out https://github.com/rameshvarun/blog-cells
How class encapsulation or closure can reduce the bundle size
This community group aims to provide a space for JavaScript runtimes to collaborate on API interoperability. We focus on documenting and improving interoperability of web platform APIs across runtimes (especially non-browser ones). This is done through discussions among runtimes, proposals in specification venues (WHATWG, W3C) for new web APIs and for changes to current web APIs, and documentation of existing runtime behaviours.
Everything that does not have to be JS anymore, and there is a lot !
I didn't know about the accesskey attribute :)
Native alternatives to lodash utils
Native alternative to date-fns
Examples of UI patterns that does not need JS
Things not needed with javascript: Date-fns and Lodash at the moment.
Most of the time, your job with JavaScript to enhance components’ keyboard accessibility will be done with just a handful of tools, including the use of event listeners and certain JavaScript methods of a couple of Web APIs that can help us in this task.
- keydown event: Instead, the utility of the keydown event comes when you need to add functionality to other keys [than enter or space].
- blur event: most of the time, you’ll use it to reverse the possible changes you have made with the keydown event listener.
- focus event (rare), but instead the focus method!
button.inert
works and avoid a setAttribute.
#idea #project #vue: create a directive to handle keydown and blur event into one action that is reversible.
So now we can have a look at component patterns:
- toggletips
- tabs
- modals
Use one package manager built on top of corepack to support npm, yarn and pnpm.
#idea #project support more package managers such as cargo, deno, ... :)
Oh wait, there is already something https://github.com/egoist/dum
The way to bundle JS projects 😃
How to structure a website that is not built with an SPA style?
const
only ensures that the reference is not modified. The data referenced can be modified though.
Also, primitive data types are immutable. So a const a = 5
can not be updated as 5 as Number can not change.
When we use const, we create an indestructible link between a variable name and a piece of data. We're still allowed to modify the data itself though!
How to create a web worker?
- Create a script that imports another one with
const worker = new Worker('worker.js'
- Bind events emitted by the worker with
worker.onmessage = function(event) { ... }
- Do the same in the web worker with
self.onmessage = function(event) { ... }
- Exchange messages with
worker.postMessage(payload)
orself.postMessage(payload)
One key difference between Web Workers and the main thread is that Web Workers have no access to the DOM or the UI. This means that they cannot directly manipulate the HTML elements on the page or interact with the user.
Get the event information of a keydown event :)