-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: vite-plugin-attributes #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…onfiguration files Signed-off-by: GitHub <noreply@github.com>
|
Deploying with
|
Status | Name | Latest Commit | Preview URL | Updated (UTC) |
---|---|---|---|---|
✅ Deployment successful! View logs |
packages | f496d6b | Commit Preview URL Branch Preview URL |
Aug 05 2025, 10:18 PM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @mcansh, 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 PR introduces a new Vite plugin designed to automatically remove specified HTML attributes from JSX/TSX files during the build process. Its primary purpose is to help optimize production bundles by stripping out development-only attributes like data-testid
, ensuring cleaner and potentially smaller client-side code.
Highlights
- New Vite Plugin: I've added
@mcansh/vite-plugin-attributes
, a new Vite plugin to the monorepo. - Attribute Removal: This plugin automatically removes specified HTML attributes from
.tsx
and.jsx
files during the build process. - Configurable Attributes: While it defaults to removing
data-testid
attributes, users can configure an array of custom attributes to be removed. - Production Optimization: The plugin is enabled by default only in production environments, ensuring development attributes are present during development but stripped for deployment.
- Efficient Transformation: The transformation logic uses
magic-string
for efficient and accurate source code manipulation, preserving source maps. - Comprehensive Testing: The core attribute removal logic is thoroughly tested using Vitest, covering various scenarios including default and custom attribute removal.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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 or fill out our survey to provide feedback.
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
-
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. ↩
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #58 +/- ##
==========================================
+ Coverage 93.80% 94.05% +0.24%
==========================================
Files 19 20 +1
Lines 872 908 +36
Branches 215 221 +6
==========================================
+ Hits 818 854 +36
Misses 54 54 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 introduces a new Vite plugin, vite-plugin-attributes
, to remove specified attributes from code, which is a great addition. The implementation is solid, but I've identified a critical bug in the core logic that could lead to code corruption, as well as a configuration issue in package.json
that prevents tests from running correctly. My review includes suggestions to fix these issues and improve the code's robustness and readability.
Signed-off-by: GitHub <noreply@github.com>
…tMeta' for consistency Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
commit: |
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
…overrides Signed-off-by: GitHub <noreply@github.com>
…-dom Signed-off-by: GitHub <noreply@github.com>
…age instructions Signed-off-by: GitHub <noreply@github.com>
…nd language support Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
No description provided.