Skip to content
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

Migrate Starter to Shiki Version 3 from Version 1 #71

Open
theDeal opened this issue Feb 23, 2025 · 0 comments
Open

Migrate Starter to Shiki Version 3 from Version 1 #71

theDeal opened this issue Feb 23, 2025 · 0 comments

Comments

@theDeal
Copy link

theDeal commented Feb 23, 2025

Description:

We currently rely on Shiki version 1 for syntax highlighting in our Next.js starter project. With the release of Shiki version 3—which brings improvements in performance, theme handling, and API consistency—it’s time to upgrade our integration.

Migration Goals:

  • Upgrade Dependency: Update the project’s package.json to reference Shiki v3.
  • API Updates: Refactor our codebase to accommodate breaking changes and new API patterns introduced in v3.
  • Automated Migration: Utilize the automated migration approach as described in the Shiki blog post to streamline changes. (See [Automated Migration Guide](https://shiki.matsu.io/blog/v2#automated-migration) for details.)
  • Testing: Ensure that both server-side rendering and static builds in Next.js continue to display syntax-highlighted code correctly after migration.
  • Documentation: Update our project documentation to reflect the changes in configuration and usage with Shiki v3.

Tasks:

  1. Update Package Dependency:

    • Change the Shiki dependency from version 1 to version 3 in package.json.
    • Run a fresh install to update node modules.
  2. Run Automated Migration Script:

  3. Code Refactoring:

    • Review the migration output for any manual adjustments needed.
    • Update any custom integrations or overrides to work with the new API.
  4. Testing:

    • Execute the existing test suite to ensure nothing breaks.
    • Manually verify syntax highlighting in both development and production builds.
    • Check for any visual discrepancies or performance regressions.
  5. Documentation:

    • Update README and any related docs with the new installation and usage instructions for Shiki v3.
    • Add notes on migration steps for future reference.

Additional Context:

The automated migration instructions from the Shiki team provide a clear path for updating from earlier versions. This migration is critical to take advantage of the latest features and maintain compatibility with modern Next.js setups.

Let’s prioritize this update to ensure our starter project remains up to date and fully leverages the improvements in Shiki v3.

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

No branches or pull requests

1 participant