Feedback on the new /api/import
I do not like that it strips the incoming markdown cells. While imports are sort of behind the scenes I liked that Observable notebooks used to be pure modular composition. With markdown stripped low level agents cannot read the high level intent of modules. Imports become 2nd class modules from the main one. It makes working with multiple modules slightly harder, as you now definitely need to have each one open in a separate app view to get all the information to your finger tips.
Probably there is some performance argument that they are functionally pointless, but I preferred the symmetry. I don’t expect anything to be changed but I share my opinion just to put it in writing.
Hi Tom. Thanks for the feedback.
The /api/import and all other /api/ routes are private APIs and so you shouldn’t depend on their behavior for anything. We’ll have a forthcoming public API but the public API will live in a different location and have different semantics — hopefully that should better support agents and a variety of other workflows. Please don’t build anything on our private API in the interim, as it’s likely to break!
Yes I am not touching them, I just see the markdown cells are missing from the runtime for imports and traced it to that.
Using prototype patching to extract a reference to the runtime is also, as you might guess, an internal API that we don’t support or recommend using.
Once we have a public API though I’m sure you could do lots of fun introspection.