Skip to content

Conversation

@rayterion
Copy link

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

ESM migration for docusaurus-plugin-pwa package.

Note: i would appreciate some feedback.

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Jan 12, 2026
@socket-security
Copy link

socket-security bot commented Jan 12, 2026

@rayterion rayterion changed the title refactor: made package esm ESM migration: docusaurus-plugin-pwa Jan 12, 2026
@netlify
Copy link

netlify bot commented Jan 12, 2026

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 18563b5
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/69657508cbf82e00083522e0
😎 Deploy Preview https://deploy-preview-11657--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@rayterion rayterion marked this pull request as ready for review January 12, 2026 22:35
@rayterion
Copy link
Author

rayterion commented Jan 12, 2026

If this PR gets merged i might start migrating other packages.

@slorber slorber marked this pull request as draft January 15, 2026 17:35
@slorber slorber added this to the 4.0 milestone Jan 15, 2026
@slorber
Copy link
Collaborator

slorber commented Jan 15, 2026

Thanks

This is a public-facing package that users can require, so I'd rather merge this only after we upgrade to Node 22 (https://nodejs.org/en/blog/release/v22.0.0) because not supporting require(esm) would break retrocompatibility.

Although in practice I doubt many users do require("@docusaurus/plugin-pwa"), it is still a possibility that we'd prefer not break.
requiring/importing/extending other plugins is more common, see #4138 (comment)
We'd rather keep this extension pattern working for v3, using commonjs require or esm imports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants