Let us see the response to: "Street Fighter the movie has a better plot than Street Fighter the game." |
// Example way to construct a Bus | |
// | |
// const ctrl = new SharedArrayBuffer(12); | |
// const size = new SharedArrayBuffer(4); | |
// let busSize = 4096; | |
// const data = new SharedArrayBuffer(busSize); | |
// const bufs = {ctrl,size,data,}; | |
// const bus = new Bus(bufs); | |
'use strict'; |
module.exports = { | |
__proto__: null, | |
START: 0, | |
WORKER_READY: 2, | |
BUS_READY: 3, | |
BUS_DRAINED: 4, | |
BUS_END: 5, | |
WORKER_ERROR: 6, | |
}; |
console.log('hi'); | |
module.exports = 123; |
{ | |
async resolve() { | |
const dep = vm.Module('export let a = 0; ({set a(v) {a = v;} get a() {return a;}})'); | |
dep.onEvaluated((ns, reflect) => { | |
setInterval(() => reflect.a++, 1000); | |
}); | |
return dep; | |
} | |
} |
<!doctype html> | |
<html> | |
<style> | |
.screenreader-only { | |
position: absolute; | |
display: block; | |
left: -1px; | |
top: -1px; | |
width: 1px; | |
height: 1px; |
// allocate a private field key
private #constructedHere;
export let create = () => {
return {
// cannot be used in computed properties
// #constructedHere is not a variable with a reified value
#constructedHere: true
};
ESM do not have a way to setup modules that are aliases of other modules
ESM in in browsers cannot reliably use export * from
to act as an alias since it may alter the shape of the namespace they are importing, nor can they use HTTP redirects which are treated as new module records.
Adding default
to the list of exports from export * from
has been revisted and rejected.
I have to take extra effort to use export *
reliably as a means to create pass through modules.
Typically involving resolving, fetching, and parsing the source text of a dependency outside of VM control.
This can be seen in projects where I am invoking http/file access and parsing to AST to figure out if the module being delegated to has a default.
In addition using export *
is also not suitable to be used
** bikeshed **
fs.getFile(url)
- https://developer.mozilla.org/en-US/docs/Web/API/File
Can be used by loaders/servers if they wish to request information about the file's MIME as file.type
.
It will get the .type
by checking the context for the current MIME DB, falling back to the globally MIME DB.