Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web extension support #52

Open
gnestor opened this issue Jan 12, 2023 · 4 comments
Open

Add web extension support #52

gnestor opened this issue Jan 12, 2023 · 4 comments

Comments

@gnestor
Copy link

gnestor commented Jan 12, 2023

It would be great if this extension could be installed and used in a browser context. The motivation is to be able to share notebooks with people by simply sharing a URL (assuming that the notebook is publicly available on Github or somewhere else that's accessible from vscode.dev). Additionally, in Zen Mode, VS Code notebooks look pretty approachable:

image

Currently, the Observable JS extension can't be installed from vscode.dev:

image

According to the docs: https://code.visualstudio.com/api/extension-guides/web-extensions#web-extension-enablement

VS Code automatically treats an extension as a web extension if:

  • The extension manifest (package.json) has browser entry point.
  • The extension manifest has no main entry point and none of the following contribution points: localizations, debuggers, terminal, typescriptServerPlugins.

If an extension wants to provide a debugger or terminal that also work in the web extension host, a browser entry point needs to be defined.

Some VS Code APIs are not available in a browser context so it may require a bit of refactoring, or not!

@GordonSmith
Copy link
Owner

FYI GitHub Blocks will allow this (in early access):
OJS

@GordonSmith
Copy link
Owner

Which also allows you to write OJS to view other file types:
DuckDB

@gnestor
Copy link
Author

gnestor commented Jan 13, 2023

@GordonSmith Wait, you're blowing my mind right now! I signed up for the beta a while ago and still waiting for access. So it looks like you created some custom blocks, one for Observable notebooks and Data File Preview which renders specific file types (like CSV and Parquet) and uses the Observable runtime to provide table preview, data wrangler, etc., is that correct? This is a game-changer for Github! It seems like Blocks is not intended for editing though, so if you wanted to share a notebook with someone and allow them to edit, they would need to download and install VS Code. If this extension worked in the browser (web extension), then notebooks could be easily edited in the browser.

@GordonSmith
Copy link
Owner

@gnestor - correct, FWIW the blocks API does support editing, but recreating a functional notebook UI is a bit of work... Mind you supporting an editable OMD document wouldn't be hard...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants