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

Refactor so that all vscode-specific infoview stuff is in vscode_info_server.ts #204

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

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

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`
infoview/extension.ts Outdated Show resolved Hide resolved
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants