Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Conversation

@EdAyers
Copy link
Contributor

@EdAyers EdAyers commented Jul 8, 2020

A refactoring, no new functionality.

This is to maximise code reuse with the lean-web-editor project.
All code that is specific to vscode is now in infoview/vscode_info_server.ts and infoview/index.tsx, which contains an instance of InfoServer.
So it should only be necessary to re-implement this file to get the infoview system
to work in lean-web-editor.

Additionally:

  • onPin is now optional, if onPin is not provided then Info will not
    show the pin button
  • rename DOM id react_root to infoview_root since lean-web-editor uses React and so react_root is no longer the root

todo

  • test etc
  • get lean-web-editor working using the contents of infoview with only 'extension.ts' reimplemented. So likely I will have to change this again

EdAyers added 5 commits July 8, 2020 14:43
This is to maximise code reuse with the lean-web-editor project.
All code that is specific to vscode is now in extension.ts.
So it should only be necessary to implement this file to get the system
to work in lean-web-editor.

Additionally:

- index.tsx has been split in to Main.tsx and index.tsx. index.tsx is
  vscode specific
- Main has been split in to `Main` and `InfoView` components. This is to
  separate the stateful parts of Main.
- onPin is now optional, if onPin is not provided then Info will not
  show the pin button
- rename DOM id `react_root` to `infoview_root`
EdAyers added 4 commits July 8, 2020 16:44
It's an abstraction that tells you what the editor needs to implement to
get infoviews to work.
Note that config and position are not included as events, they should be
passed in as props.
- Remove extension.ts
- Move types needed by lean-web-editor to types.ts
- Move trythis.ts to infoview
- Change rootDir of tsconfig from `./src` to `.`
- Hardcode copy-to-comment svg in to infoview code. This means there is
  duplication but there is already duplication for the light/dark
versions. Seems neater to just have all the svgs inline. Also means we
can remove dependency on webpack svg loader.
@EdAyers EdAyers changed the title Refactor so that all vscode-specific infoview stuff is in extension.ts Refactor so that all vscode-specific infoview stuff is in vscode_info_server.ts Jul 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants