Notes-03-28-digital-signing-webpack-dynamic-import-JsonRest-Promise-pattern-performance.measure()
Digital Signing
Terms:
digest: hash of the doc
Normal flow:
Sender
var digest = hash(doc);
send({
counterpart: doc.copy(),
encryption: encrypt(digest)
})Receiver
var digestByCounterpart = hash(counterpart);
var digest = decrypt(encryption);
isEqual(
digestByCounterpart,
digest
);With CA:
Sender
Receiver
Keys
CA need to be trusted
TODO
Webpack Dynamic Import
Use
import(${path}), webpack resolves it in a jsonp waywebpack will do code splitting (generate different bundle) for each module that is NOT in the dependency tree of
App.js(not imported yet)webpack will download the splitted js file when imported is called
webpack uses
webpackJsonp()as a global callback to inject the module into the main bundle (main dependency tree)Once the dynamic import is done, the next same import will be static
if the dynamic imported file is already in main dependency tree(be imported my some other file), it will not be code splitted, dynamic import will be transformed to static as 5 does
Promise pattern JSONRest
Promise Pattern
sync Promise
In runkit:
will print out:
chaining
will output
Measure Regexp
Regex check
with create regex everytime
with cached regex object
for manual check
Last updated
Was this helpful?