Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[React]: Add initial usage of the new web worker-based cody web chat#62792

Merged
vovakulikov merged 20 commits into
mainfrom
vk/integrate-cody-web-chat
Jun 26, 2024
Merged

[React]: Add initial usage of the new web worker-based cody web chat#62792
vovakulikov merged 20 commits into
mainfrom
vk/integrate-cody-web-chat

Conversation

@vovakulikov

@vovakulikov vovakulikov commented May 20, 2024

Copy link
Copy Markdown
Contributor

Part of https://github.com/sourcegraph/sourcegraph/issues/62448
Linear issue SRCH-573

This is highly experimental usage of the new (not currently merged but published in NPM cody-web-experimental) package

How to run it

  • (Optional) if you previously linked any local packages make sure they don't exist in your node_modules anymore, rm -rf node_modules in the root then pnpm install
  • Run standard sg start web-standalone
  • Turn on newCodyWeb: true in your experimentalFeatures

How to run it locally with prototype PR in Cody repository

  • Open Cody repository on the vk/integrate-cody-web-chat-2 branch
  • At the root of the repo, run pnpm install to make sure you're up to date with all of the dependencies.
  • Go to the web package (cd web)
  • Build it with pnpm build
  • Create a global link with pnpm link --global (Ignore the warning message about no binary)
  • Open sourcegraph/sourcegraph repository on this PR branch
  • Make sure you are in the root of the repo.
  • Run pnpm link --global cody-web-experimental
  • Run sg start web-standalone to bundle the web app and launch an instance that uses S2 for the backend. You'll need to create a login on S2 that is not federated by GitHub.
  • Turn on newCodyWeb: true in your experimentalFeatures
  • Have fun experimenting!

Test plan

  • Check that old version of Cody has got no regressions

@cla-bot cla-bot Bot added the cla-signed label May 20, 2024
@vovakulikov vovakulikov self-assigned this May 20, 2024
@peterguy peterguy changed the title [React]: Add super simple usage of the new wob worker based cody chat [React]: Add super simple usage of the new web worker based cody chat Jun 12, 2024
@peterguy peterguy changed the title [React]: Add super simple usage of the new web worker based cody chat [React]: Add super simple usage of the new web worker-based cody chat Jun 12, 2024
@vovakulikov vovakulikov changed the title [React]: Add super simple usage of the new web worker-based cody chat [React]: Add initial usage of the new web worker-based cody web chat Jun 26, 2024
@vovakulikov vovakulikov force-pushed the vk/integrate-cody-web-chat branch from 5c3f7d9 to 31a7de1 Compare June 26, 2024 03:58
@vovakulikov vovakulikov requested review from a team and peterguy June 26, 2024 05:56
@vovakulikov vovakulikov marked this pull request as ready for review June 26, 2024 05:56
{
path: path.join(STATIC_ASSETS_PATH, 'chunks/chunk-*.js'),
maxSize: '600kb', // 2 monaco chunks are very big
maxSize: '6.45MB', // Cody web chunk is very big

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I couldn't find a way to name Cody Web chunk with a specific name.
We've already been violating this rule in different ways so I think this is tolerable

@@ -0,0 +1,419 @@
import React, { useEffect, useState } from 'react'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file just a copy of the old page, no logic has been changed here

@fkling fkling left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't do a detail review but I looked through it. Since it's gated behind a flag it seems safe to merge. Just want to point out https://github.com/sourcegraph/sourcegraph/pull/63430 which also makes changes to CodyChatPage.tsx, so that needs to be coordinated somehow.

@peterguy peterguy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran a functional test locally against S2; it behaved correctly. Didn't try to break it too much.

@vovakulikov vovakulikov merged commit a61c881 into main Jun 26, 2024
@vovakulikov vovakulikov deleted the vk/integrate-cody-web-chat branch June 26, 2024 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants