I would like to explore the (development version of) source code of Observable Standard Library during debugging. However, the approach I use below can only get me to the production code or minified code, not the development one. How can I get around this? Thanks
My approach
in a cell of a new notebook, type the following
{
debugger;
html`<canvas width=60 height=50>`
}
cmd + option + j to open the debugger
run the cell to trigger the debugger
cmd + ; to step into the standard library function I want to explore
then I get into the minified version (but I want to explore development version) of standard library
We don’t ship the development version of the standard library in production, but you can explore it to your heart’s desire in the open source repository, here:
For example, here’s the underlying source of the built-in html function:
Yes, you are right that we can read the source code from the repo, but it feels so convenient to be able to see the source from the devtool when we debug it.
Maybe, I could make a development version for my own use by copying and pasting the std source code into a notebook and import needed functions in other notebooks?
By the way, I really really appreciate the creation of Observable notebook, it is truly magic and wonderful! Thank you all so much!
I agree that a compiled but unminified variant that can be required/imported separately would be nice, especially in more complex areas like Generators. Many packages, among them d3, offer both variants.