observablehq / stdlib

The Observable standard library.
https://observablehq.com/@observablehq/standard-library
ISC License
966 stars 83 forks source link

Part of (compiler-refactor) #29

Closed jashkenas closed 6 years ago

jashkenas commented 6 years ago

Only a small change to the standard library:

mbostock commented 6 years ago

I’m okay with renaming to Library and making it the default export. 👍

I’m wary of exporting the static namespaces. First, mixing default and named exports is a little awkward when transpiling back to ES5. More importantly, it locks us in to those symbols being static, rather than being able to configure them dynamically when the library is constructed. And it feels weird that these namespaces are available statically, but the rest of stdlib (require, md, etc.) is not.

jashkenas commented 6 years ago

Alright — changed to that the runtime has to go through a stdlib Library instance in order to access "observe" and "input".