Skip to content

Conversation

@adnaan
Copy link
Contributor

@adnaan adnaan commented Dec 13, 2025

Summary

  • Replace custom serveClientLibrary function with e2etest.ServeClientLibrary from lvt/testing package
  • This ensures the chat example uses the same embedded client library as other examples
  • Fixes CI test failures in cross-repo tests where the client couldn't be found

Root Cause

The chat example had a custom serveClientLibrary function that looked for the client in local paths:

  • livetemplate-client.js
  • ../client/dist/livetemplate-client.browser.js
  • ../../client/dist/livetemplate-client.browser.js

But the CI workflow copies the client to lvt/testing/livetemplate-client.browser.js, which is then embedded via go:embed in the lvt/testing package.

Test plan

  • Build passes locally
  • CI tests pass

🤖 Generated with Claude Code

Replace custom serveClientLibrary function with e2etest.ServeClientLibrary
from lvt/testing package. This ensures the chat example uses the same
embedded client library as other examples, fixing CI test failures where
the client couldn't be found.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 13, 2025 15:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the custom serveClientLibrary function in the chat example with the standardized e2etest.ServeClientLibrary function from the lvt/testing package. This change ensures consistency with other examples and fixes CI test failures where the client library couldn't be found at the custom paths.

Key Changes:

  • Removed custom client library serving logic that searched multiple local paths
  • Added dependency on github.com/livetemplate/lvt/testing package
  • Updated to use the embedded client library via e2etest.ServeClientLibrary

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
chat/main.go Replaced custom serveClientLibrary function with standardized e2etest.ServeClientLibrary import and usage
chat/go.mod Added github.com/livetemplate/lvt dependency to support the new client library serving approach
chat/go.sum Updated checksums to include the new lvt/testing dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

require (
github.com/chromedp/chromedp v0.14.2
github.com/livetemplate/livetemplate v0.7.0
github.com/livetemplate/lvt v0.0.0-20251213063335-769e058d10cd
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

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

The version of github.com/livetemplate/lvt being added (v0.0.0-20251213063335-769e058d10cd) is newer than the versions used in most other examples. For consistency, consider using the same version that other examples use (v0.0.0-20251130141940-9b94cde94e9d as used in counter, avatar-upload, and todos examples), unless there's a specific reason this example requires a newer version. Version inconsistencies across examples can make maintenance more difficult and may lead to unexpected behavior differences.

Suggested change
github.com/livetemplate/lvt v0.0.0-20251213063335-769e058d10cd
github.com/livetemplate/lvt v0.0.0-20251130141940-9b94cde94e9d

Copilot uses AI. Check for mistakes.
@adnaan adnaan merged commit 85c2c63 into main Dec 13, 2025
15 checks passed
@adnaan adnaan deleted the fix/chat-use-lvt-testing-client branch December 13, 2025 15:19
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