-
Notifications
You must be signed in to change notification settings - Fork 56
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
Publish @lean4/infoview to npm #203
Comments
The infoview depends on the following: "dependencies": { I wonder if widgets really want to depend on all these things, indirectly. Perhaps what we need instead is an "infoview-react" package that contains just fully reusable handy react components like Also do we only support Typescript, or can it also be used by pure Javascript widget implementations? Do we need to support both React classes and React hooks? These seem to be the sorts of things react component developers talk about in their libraries... Then there's testing, do we have the infoview running in other editors yet? How do things like dependencies on vscode provided CSS work out? Should the infoview be checked to create some abstraction layer there isolating those sorts of vscode only dependencies, then test that the infoview works standalone in a web browser or something...? |
I think having a The lean4-infoview package and dependencies won't actually be bundled with the user-widgets, because it will be marked as an external dependency in the user-widget's bundler. So the dependencies are not duplicated or cluttering up the user-widget bundle. This will cause breaking changes if we change the code, but we can think about stabilising later. I think all of the npm dependencies of
So the only deps that we would save from having an extracted
If it's packaged correctly it should support both typescript and javascript fine.
I think everyone uses hooks these days. There are no breaking compatibility issues between hooks and classes as far as I can tell.
I guess tests would live in the root
You just get whatever CSS is loaded in the infoview, there is no attempt to manage this. Maybe in the future, once tachyons is gone, we can start thinking about how to manage this properly.
The only vscode-only dependencies are the codicons which are purely aesthetic, the infoview is usable from within other editors in theory. |
We now have |
A prerequisite for leanprover/lean4#1238 is to have the
./lean4-infoview
folder to be published on npm, so that widget code can reference it. This is useful for allowing users to reuse infoview components such as the tagged expression renderer.We can use external libraries so that the infoview doesn't have to dynamically load copies of itself, but having it in npm means that people can target it and not have typescript errors while they are building user-widget bundles.
Perhaps this could be automated so that each release of vscode-lean4 includes a release of
@lean4/infoview
on npm?The text was updated successfully, but these errors were encountered: