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
Have an option where remote definitions can be dynamically fetched and bundled with the ES module source, eliminating the need for static imports. example:
// from "https://example.com/define1.js"functiondefine1(runtime,observer){
...
}// from "https://example.com/define2.js"functiondefine2(runtime,observer){
...
}// from "https://example.com/define3.js"functiondefine3(runtime,observer){
...
}exportdefaultfunctiondefine(runtime,observer(){
...
}
Nested/recursive definitions may be fun to work out...
3) export cell definitions
Brought up in #28. Export the cell definitions for defined cells.
If a cell name is define, would that clash with the default exported define? I guess we don't have to give a name to the default exported define function in this case
probably can't use this and the potential bundled option from above
The function signatures wouldn't be deterministic. For example:
x=a+b+c+d
would give:
exportfunctionx(a,b,c,d){returna+b+c+d;}
But, if x is given like:
x = d + c +b + a
As the compiler currently stands, it would give out:
exportfunctionx(d,c,b,a){returnd+c+b+a;}
It would be nice to have deterministic function signatures for these exported functions, and not determined by which cell is referenced first in the definition. One way could be:
The PR at #29 is already quite lengthy, so thought I would break out this idea into in a separate issue for a future release.
1) Make the
export default
prefix optional.So you can just compile to a
function define(runtime, observer) {...}
(good for compiling for environments that dont have ES modules2) bundle imported defines into same file
Instead of:
Have an option where remote definitions can be dynamically fetched and bundled with the ES module source, eliminating the need for static imports. example:
Nested/recursive definitions may be fun to work out...
3) export cell definitions
Brought up in #28. Export the cell definitions for defined cells.
3 potential issues:
define
, would that clash with the default exporteddefine
? I guess we don't have to give a name to the default exporteddefine
function in this casebundled
option from abovewould give:
But, if
x
is given like:As the compiler currently stands, it would give out:
It would be nice to have deterministic function signatures for these exported functions, and not determined by which cell is referenced first in the definition. One way could be:
The text was updated successfully, but these errors were encountered: