Skip to content

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented May 19, 2025

Summary

Transpile the Svelte package to downgrade the syntax. The package contains ES2020 syntax, such as optional chaining.

Screenshot 2025-05-19 at 14 14 55

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings May 19, 2025 06:17
@netlify
Copy link

netlify bot commented May 19, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 31701f6
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/682acd1108be740008997cb3
😎 Deploy Preview https://deploy-preview-5272--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 76 (🟢 up 2 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

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 modifies the Svelte plugin to transpile the Svelte package, ensuring that newer syntax (e.g., optional chaining) is downgraded. Key changes include:

  • Importing EnvironmentConfig from @rsbuild/core.
  • Adding an environment configuration hook via api.modifyEnvironmentConfig.
  • Integrating the transpilation logic conditioned on the Svelte version.
Comments suppressed due to low confidence (1)

packages/plugin-svelte/src/index.ts:81

  • [nitpick] Ensure that the regex pattern correctly captures all intended Svelte package paths across different environments. It might be useful to note any assumptions about path separators for future reference.
include: [/node_modules[\/]svelte[\/]/],

@chenjiahan chenjiahan merged commit a4579a3 into main May 19, 2025
12 checks passed
@chenjiahan chenjiahan deleted the transpile_svelte_0519 branch May 19, 2025 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants