You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are three ways to get rid of the $ requirement, but all have trade-offs.
Install exports onto globalThis. This could clobber built-ins and break things For example, if someone writes the code export const postMessage = () => {}, the worker won't be able communicate with the main page anymore.
Auto-destructure values from $, eg add "const a = $.a" to the prelude. However this would make values early bound, whereas we want them to be late bound (lookup on use).
Use Babel to transpile unbound globals, eg "console.log(a) -> console.log($.a)". However, it means that newer JS syntax can't be used in a notebook without upgrading it's Babel version.
Already implemented 3 in 283d100, but removed since I didn't have time to fully test.
The text was updated successfully, but these errors were encountered:
There are three ways to get rid of the
$
requirement, but all have trade-offs.globalThis
. This could clobber built-ins and break things For example, if someone writes the codeexport const postMessage = () => {}
, the worker won't be able communicate with the main page anymore.$
, eg add "const a = $.a" to the prelude. However this would make values early bound, whereas we want them to be late bound (lookup on use).Already implemented 3 in 283d100, but removed since I didn't have time to fully test.
The text was updated successfully, but these errors were encountered: