Skip to content

feat(rstest): add rspack-adapter example#412

Merged
9aoy merged 6 commits intomainfrom
rspack-rstest-adapter
Mar 17, 2026
Merged

feat(rstest): add rspack-adapter example#412
9aoy merged 6 commits intomainfrom
rspack-rstest-adapter

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Mar 17, 2026

add rspack-adapter example.

https://rstest.rs/guide/integration/rspack

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new example project that integrates rstest with Rspack, providing a practical demonstration of how to set up a React and TypeScript application using Rspack as the bundler. The example includes all necessary configuration files, dependencies, and a basic application structure to serve as a reference for users looking to combine these technologies.

Highlights

  • New Rspack Adapter Example: A new example project has been added under rstest/rspack-adapter to demonstrate the integration of rstest with Rspack.
  • React and TypeScript Setup: The example includes a complete setup for a React and TypeScript application, showcasing common configurations for development and production with Rspack.
  • Rstest Configuration: The example configures rstest to work seamlessly within the Rspack environment, including test setup files and TypeScript configurations for testing.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • rstest/rspack-adapter/.gitignore
    • Added a new .gitignore file to exclude local, dist, profile, and IDE-related files for the rspack-adapter example.
  • rstest/rspack-adapter/README.md
    • Added a README file detailing setup, development, build, and preview instructions for the Rspack project, along with links to Rspack resources.
  • rstest/rspack-adapter/index.html
    • Added the base HTML file for the Rspack + React + TypeScript application.
  • rstest/rspack-adapter/package.json
    • Added the package.json file, defining project metadata, scripts for build, dev, preview, and test, and listing dependencies and devDependencies for React, Rspack, and rstest.
  • rstest/rspack-adapter/rspack.config.ts
    • Added the Rspack configuration file, setting up entry points, target browsers, module resolution, rules for assets, CSS, and TypeScript/JavaScript files with SWC loader, and Rspack plugins like HtmlRspackPlugin and ReactRefreshRspackPlugin.
  • rstest/rspack-adapter/rstest.config.mts
    • Added the rstest configuration file, extending withRspackConfig and specifying a setup file for tests.
  • rstest/rspack-adapter/src/App.css
    • Added CSS styles for the main React application component, including root styling, logo animations, and card presentation.
  • rstest/rspack-adapter/src/App.tsx
    • Added the main React application component, featuring a stateful counter, React logo, and instructional text.
  • rstest/rspack-adapter/src/assets/react.svg
    • Added the SVG asset for the React logo.
  • rstest/rspack-adapter/src/index.css
    • Added global CSS styles for the application, defining root font properties, link styles, body layout, heading size, and button styling, with media queries for light mode.
  • rstest/rspack-adapter/src/main.tsx
    • Added the entry point for the React application, rendering the App component into the DOM.
  • rstest/rspack-adapter/tests/index.test.tsx
    • Added a basic test file using rstest and @testing-library/react to verify the main page renders correctly.
  • rstest/rspack-adapter/tests/rstest.setup.ts
    • Added a rstest setup file to extend expect with jest-dom matchers for enhanced DOM testing capabilities.
  • rstest/rspack-adapter/tests/tsconfig.json
    • Added a TypeScript configuration file specifically for the test environment, extending the base tsconfig and including types for @testing-library/jest-dom.
  • rstest/rspack-adapter/tsconfig.json
    • Added the base TypeScript configuration file for the project, defining compiler options for library, JSX, target, modules, and strict type checking.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new example for rspack-adapter. The overall structure and implementation are well done. I've provided a few suggestions to improve code robustness, maintainability, and testing practices. These include adding a null check for the root DOM element, improving the Rspack configuration, updating a URL, sorting dependencies, and using a more semantic query in a test.

9aoy and others added 5 commits March 17, 2026 15:21
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@9aoy 9aoy merged commit 3d08b90 into main Mar 17, 2026
4 checks passed
@9aoy 9aoy deleted the rspack-rstest-adapter branch March 17, 2026 07:48
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.

1 participant