Skip to content

feat(website): show WASM loading status in playground#348

Merged
hardfist merged 1 commit intomainfrom
codex/add-loading-status-for-wasm-in-playground
Sep 9, 2025
Merged

feat(website): show WASM loading status in playground#348
hardfist merged 1 commit intomainfrom
codex/add-loading-status-for-wasm-in-playground

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

@hardfist hardfist commented Sep 9, 2025

Summary

  • show loading state while the playground initializes WebAssembly
  • display spinner and error message when WASM fails to load

Testing

  • pnpm run format
  • pnpm build (fails: rslib not found)
  • pnpm run test (fails: rstest not found)
  • pnpm run test:go (fails: missing module typescript-go)
  • pnpm run check-spell (fails: Forbidden - 403)
  • pnpm run lint:go (fails: Go version mismatch)

https://chatgpt.com/codex/tasks/task_e_68bf8de38430832dbf792184f2be51d8

@netlify
Copy link
Copy Markdown

netlify bot commented Sep 9, 2025

Deploy Preview for rslint ready!

Name Link
🔨 Latest commit 3cc955c
🔍 Latest deploy log https://app.netlify.com/projects/rslint/deploys/68bf8f63a716db00083b60cd
😎 Deploy Preview https://deploy-preview-348--rslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hardfist hardfist marked this pull request as ready for review September 9, 2025 03:23
Copilot AI review requested due to automatic review settings September 9, 2025 03:23
@hardfist hardfist merged commit 8594da2 into main Sep 9, 2025
17 checks passed
@hardfist hardfist deleted the codex/add-loading-status-for-wasm-in-playground branch September 9, 2025 03:23
Copy link
Copy Markdown
Contributor

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 enhances the Rslint playground by adding visual feedback for WebAssembly initialization status. The implementation shows a loading spinner while WASM loads and properly handles error states when initialization fails.

Key changes:

  • Added loading state management with spinner UI during WASM initialization
  • Enhanced error handling to display errors even before playground is fully initialized
  • Improved user experience by providing visual feedback during async operations

Reviewed Changes

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

File Description
website/theme/components/Playground/index.tsx Added loading state management and error handling for WASM initialization
website/theme/components/Playground/ResultPanel.tsx Enhanced to display loading spinner and error messages during initialization
website/theme/components/Playground/ResultPanel.css Added CSS styles for loading spinner animation

async function runLint() {
try {
setError(undefined);
if (!initialized) setLoading(true);
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

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

This condition will cause the loading state to be set to true on every lint run before initialization, but it won't be set to false if the service is already cached and no async operation occurs. The loading state should be managed based on whether an async operation is actually happening.

Suggested change
if (!initialized) setLoading(true);
if (!rslintService) setLoading(true);

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +27
const { diagnostics, ast, error, initialized, fixedCode, typeInfo, loading } =
props;
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

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

[nitpick] The destructuring spans multiple lines unnecessarily. Consider keeping it on a single line or using individual const declarations for better readability.

Suggested change
const { diagnostics, ast, error, initialized, fixedCode, typeInfo, loading } =
props;
const { diagnostics, ast, error, initialized, fixedCode, typeInfo, loading } = props;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants