Skip to content

Conversation

lerrybe
Copy link
Contributor

@lerrybe lerrybe commented Sep 2, 2025

Related Issue

#140

  • The CI integration work has been deferred due to repository forking limitations. (Testing revealed that the functionality works properly within the forked repository.)
  • To properly test workflows, It needs either same-repository testing (fork-to-fork) or cross-repository workflow configuration enabled, which appears to require additional setup. This will be addressed in a follow-up PR.

Summary

Add a simple bash script to test framework compatibility across React, Vue, and Svelte examples.

What the Script Does

The scripts/cross-framework-build-test.sh script:

Auto-Discovery

  • Automatically finds all framework directories in example/

Build Validation

  • Checks each framework has a valid directory and package.json
  • Installs dependencies (npm install) if node_modules is missing
  • Runs npm run build for each framework
  • Tracks success/failure for each build

Usage

$ ./scripts/cross-framework-build-test.sh

Screenshots

Vue Svelte React
스크린샷 2025-09-06 오후 4 03 09 스크린샷 2025-09-06 오후 4 02 59 스크린샷 2025-09-06 오후 4 02 46
All successful cases Some failure cases
스크린샷 2025-09-16 오전 1 35 47 스크린샷 2025-09-16 오전 1 36 39

Copy link

vercel bot commented Sep 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
thorvg-perf-test Ready Ready Preview Comment Sep 15, 2025 4:30pm

@lerrybe lerrybe changed the title examples: Add automated Cross-Framework testing for Web Component (React.js) examples: Add automated Cross-Framework testing for Web Component Sep 6, 2025
@lerrybe lerrybe marked this pull request as ready for review September 7, 2025 05:45
@lerrybe lerrybe changed the title examples: Add automated Cross-Framework testing for Web Component examples: Add automated Cross-Framework testing for Web Component (React, Vue, Svelte) Sep 7, 2025
Comment on lines 10 to 20
scripts/cross-framework-test/
├── index.js # Main entry point
├── constant/
│ └── config.js # Config and framework settings
├── lib/
│ ├── build-tester.js # Main build testing logic
│ ├── cli.js # Command line interface
│ ├── file-system.js # File system utilities
│ ├── logger.js # Logging utility
│ └── reporter.js # Results formatting and output
└── README.md # This file
Copy link
Contributor Author

@lerrybe lerrybe Sep 7, 2025

Choose a reason for hiding this comment

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

@tinyjin
I’ve drafted a proposal for issue 140. The diff is a bit large, but I believe that’s mainly because configuration files are included. 😅 If further clarification is needed, I’ll be glad to add comments. Please review with a focus on (1) the example setup and (2) the script structure. Thank you.

@tinyjin tinyjin requested a review from Copilot September 11, 2025 06:29
@tinyjin tinyjin added the example Sample Code label Sep 11, 2025
Copy link

@Copilot 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 adds automated cross-framework build testing infrastructure to verify Web Component compatibility across React, Vue, and Svelte frameworks, addressing issue #140 for thorvg.web.

  • Implements a comprehensive build testing script with auto-discovery, validation, and reporting
  • Creates example projects for React, Vue, and Svelte demonstrating ThorVG Lottie Player integration
  • Adds npm script aliases for convenient framework-specific and comprehensive testing

Reviewed Changes

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

Show a summary per file
File Description
scripts/cross-framework-test/ Core testing infrastructure with modular architecture for framework build validation
example/react/ React example project with Vite configuration and ThorVG integration
example/vue/ Vue example project with TypeScript and Vite setup
example/svelte/ Svelte example project with modern Svelte 5 configuration
package.json Added npm script aliases for cross-framework testing
README.md Updated documentation with build testing instructions
Files not reviewed (2)
  • example/svelte/package-lock.json: Language not supported
  • example/vue/package-lock.json: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +24 to +25
"vite.config.ts"
, "declarations.d.ts", "declarations.d.ts" ]
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

There are duplicate entries for 'declarations.d.ts' in the include array, and there's an extra comma before the first entry. Remove the duplicates and fix the syntax.

Suggested change
"vite.config.ts"
, "declarations.d.ts", "declarations.d.ts" ]
"vite.config.ts",
"declarations.d.ts"
]

Copilot uses AI. Check for mistakes.

@tinyjin tinyjin self-requested a review September 11, 2025 08:19
Copy link
Member

@tinyjin tinyjin left a comment

Choose a reason for hiding this comment

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

Please check comment I think testing script is over spec

package.json Outdated
"example:build:all": "node scripts/cross-framework-test/index.js",
"example:build:react": "node scripts/cross-framework-test/index.js react",
"example:build:vue": "node scripts/cross-framework-test/index.js vue",
"example:build:svelte": "node scripts/cross-framework-test/index.js svelte"
Copy link
Member

Choose a reason for hiding this comment

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

I think example related command shouldn't be here. Also I see we don't need example build scripts

@@ -0,0 +1,32 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

javascript is too much. I think simple shell scripts would be enough

Copy link
Member

@tinyjin tinyjin left a comment

Choose a reason for hiding this comment

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

  1. Please check comments.
  2. Please make sure each examples are valid page. I see example does not render animation. Even if we don't have to run visual check, at least it should be running correctly when we open local build page.
CleanShot 2025-09-30 at 03 30 13@2x

"preview": "vite preview"
},
"dependencies": {
"@thorvg/lottie-player": "^1.0.0-beta.1",
Copy link
Member

Choose a reason for hiding this comment

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

wrong version, v1.0.0-beta.1 is unavailable.

Also invalid approach, in the testing, we expect example run build test with local build.

Please check this with another examples as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

example Sample Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants