Skip to content

Conversation

@KubrickCode
Copy link
Owner

Summary

Dramatically reduce extension package size and deployment time by replacing the heavy pinyin library
and excluding dev dependencies from the VSIX package.

Changes

  1. Replace pinyin with tiny-pinyin

    • Remove pinyin library (60MB) and install tiny-pinyin (100KB)
    • Update chineseConverter to use tiny-pinyin API
    • Add TypeScript type definitions for tiny-pinyin
    • 99.83% size reduction for Chinese pinyin conversion
  2. Exclude dev dependencies from package

    • Add .vscodeignore rules to exclude Jest, TypeScript, Babel, and other dev tools
    • Remove ~120MB of unnecessary dependencies from VSIX

Impact

  • Library size: 60MB → 100KB (99.83% reduction)
  • node_modules: 187MB → 128MB (31.5% reduction)
  • Expected VSIX size: 187MB → ~8MB (95.7% reduction)
  • Deployment time: ~20x faster
  • All 167 tests passing

Test Plan

  • All unit tests pass (167/167)
  • Chinese character conversion works correctly
  • Keyboard layout conversion for all 15 languages functional
  • Package compiles without errors

Closes #41

Replace the heavy pinyin library (60MB) with tiny-pinyin (100KB) to dramatically reduce package size
  and deployment time.

Changes:
  - Remove pinyin dependency and install tiny-pinyin
  - Update chineseConverter to use tiny-pinyin API (convertToPinyin)
  - Add TypeScript type definitions for tiny-pinyin
  - All 167 tests passing including Chinese character conversion

Impact:
  - Library size: 60MB → 100KB (99.83% reduction)
  - node_modules: 187MB → 128MB (31.5% reduction)
  - Expected VSIX size reduction: ~95% after devDependencies exclusion
  - Deployment time improvement: ~20x faster

issue #41
Add .vscodeignore rules to exclude development dependencies from the packaged extension, reducing
  deployment size and time.

Excluded packages:
  - Jest testing framework and related packages (~21MB)
  - TypeScript compiler (~23MB)
  - Babel transpiler (~11MB)
  - Type definitions (@types, @sinclair, @unrs)
  - Other dev tools (caniuse-lite, handlebars, uglify-js)

Impact:
  - Removes ~120MB of unnecessary dev dependencies from package
  - Expected VSIX size: 187MB → ~8MB (95.7% reduction)
  - Significantly faster extension publishing and installation

issue #41
@gemini-code-assist
Copy link

Summary of Changes

Hello @KubrickCode, 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 significantly optimizes the extension's package size and deployment efficiency. By swapping out a large pinyin library for a much smaller alternative and meticulously excluding development-only dependencies from the final build, the VSIX package size is expected to shrink by over 95%, leading to a dramatically faster deployment process without compromising functionality.

Highlights

  • Dependency Replacement: The heavy pinyin library (60MB) has been replaced with the lightweight tiny-pinyin (100KB), resulting in a 99.83% size reduction for Chinese pinyin conversion.
  • Development Dependency Exclusion: New .vscodeignore rules have been added to prevent development dependencies like Jest, TypeScript, and Babel from being included in the VSIX package, removing approximately 120MB of unnecessary files.
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.

@KubrickCode
Copy link
Owner Author

/gemini review

Copy link

@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 delivers a massive optimization by reducing the extension package size by over 95%, which is a fantastic improvement for users. The changes are well-structured, replacing a heavy dependency with a lightweight one and cleaning up the packaged dev dependencies. I've made a couple of minor suggestions to align the new code with the project's style guide regarding alphabetical sorting, which will help with future maintainability.

@KubrickCode KubrickCode merged commit 1dfdd37 into main Sep 30, 2025
2 checks passed
@KubrickCode KubrickCode deleted the develop/shlee/41 branch October 6, 2025 08:42
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.

The problem of deployments becoming too slow after node_modules was included in the distribution.

2 participants