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

React vite webview #106

Open
wants to merge 12 commits into
base: development
Choose a base branch
from

Conversation

darkelfs56
Copy link
Contributor

@darkelfs56 darkelfs56 commented Dec 11, 2024

Hello Ola, this is me Akmal again.
I'm making this PR that implements React with Vite for Codebuddy extension webview.
I was actually following this simple video here

Related repos mentioned in the video as references are:

Also, I have this video of mine here that shows that the extension webview is indeed using React now.
The video is made unlisted, so only those who have the link can view it.
(Video link here)[https://youtu.be/2D6g_15--hc]

Issues

The only issues that I had was that apparently, I cannot make use of getConfigValues, or rather cannot make use of anything from the "vscode" library for building the React with Vite webview, because if you see on the package.json file itself, the "vscode" library is NOT an npm package but rather like an internal library that works inside vscode only.

  • Hence, that is why you will see that in the base web provider file, I added setInterval of 3 seconds that will post message back to the React webview if any changes in the configuration styles for the extension.

olasunkanmi-SE and others added 12 commits September 15, 2024 11:38
getWebviewContent that expects Webview and Uri
types from "vscode"
- Modified localResourceRoots to include related
files for using folder "webview-ui"
- Commented out knowledgeBaseDocs code because
not sure how to do it.
- Add setInterval every 3 seconds that will call getChatCss and
postMessage to react webview-ui if any changes
to update the current stylings.
- components folder that currently only have ChatWindow.tsx
- hooks folder that currently only have useWebviewMessages function
to listen to message sent by extensio to update chat window css.
- vite.config.ts modified to output build folder that can be used
and joined with the vscode extension Uri path.
@olasunkanmi-SE
Copy link
Owner

olasunkanmi-SE commented Dec 13, 2024

HI @darkelfs56, Akmal, I appreciate this contribution. I will look into the PR. Thanks buddy!

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