Skip to content

Conversation

e111077
Copy link
Collaborator

@e111077 e111077 commented Apr 1, 2025

update playground-elements to v0.20.0 which is more resilient to missing modules, and switch off of unpkg and onto jsdelivr for better stability

@e111077 e111077 requested a review from Copilot April 1, 2025 06:41
Copy link

@Copilot 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 fixes issues in the playground by upgrading the playground-elements dependency to v0.20.0 and shifting from unpkg to jsdelivr for improved module stability. Key changes include:

  • Adding a cdnBaseUrl parameter to the playground plugin and associated environments.
  • Modifying the content security policy in the server middleware to support jsdelivr.
  • Updating components and site configuration to incorporate the new CDN base URL.

Reviewed Changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/lit-dev-tools-cjs/src/playground-plugin/plugin.ts Extended the plugin signature to include cdnBaseUrl and injected it into the litdev-example markup.
packages/lit-dev-tools-cjs/src/lit-dev-environments.ts Added playgroundCdnBaseUrl to multiple environment configurations.
packages/lit-dev-server/src/middleware/content-security-policy-middleware.ts Updated the connect-src directive to include jsdelivr.
packages/lit-dev-content/src/components/litdev-example.ts Added a new property for cdnBaseUrl and updated the example template accordingly.
packages/lit-dev-content/site/_data/env.js Included PLAYGROUND_CDN_BASE_URL for environment data.
packages/lit-dev-content/.eleventy.js Passed the cdnBaseUrl to the playgroundPlugin in site configuration.
Files not reviewed (3)
  • package.json: Language not supported
  • packages/lit-dev-content/site/playground/index.html: Language not supported
  • packages/lit-dev-content/site/tutorials/view.html: Language not supported
Comments suppressed due to low confidence (1)

packages/lit-dev-tools-cjs/src/playground-plugin/plugin.ts:231

  • [nitpick] Consider using consistent quotation styles for HTML attribute values. For example, use double quotes for both sandbox-base-url and cdn-base-url to improve readability and maintain consistency.
        <litdev-example ${sandboxUrl ? `sandbox-base-url='${sandboxUrl}'` : ''}

@e111077 e111077 force-pushed the pge-jsdelivr branch 2 times, most recently from c61cb88 to 269b0f2 Compare April 1, 2025 07:20
@e111077
Copy link
Collaborator Author

e111077 commented Apr 1, 2025

update playground-elements to v0.20.0 which is more resilient to missing modules, and switch off of unpkg and onto jsdelivr for better stability
Copy link
Member

@sorvell sorvell left a comment

Choose a reason for hiding this comment

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

Thanks!

@sorvell sorvell merged commit 012037c into main Apr 1, 2025
14 of 15 checks passed
@sorvell sorvell deleted the pge-jsdelivr branch April 1, 2025 10:58
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.

2 participants