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

chore: fix ESLint warnings, restrict export all syntax #6605

Merged
merged 3 commits into from
Feb 4, 2022
Merged

Conversation

Josh-Cena
Copy link
Collaborator

@Josh-Cena Josh-Cena commented Feb 4, 2022

Motivation

Export all is known to not work in ESM, forcing us to use import utils from '@docusaurus/utils'; const {aliasedSitePath} = utils; instead of import {aliasedSitePath} from '@docusaurus/utils. This makes us more interoperable with ESM contexts (#6520).

In addition, I noticed in #6477 that export all seems to be discouraged. The reasoning makes sense.

Have you read the Contributing Guidelines on pull requests?

Yes

@Josh-Cena Josh-Cena added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Feb 4, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 4, 2022
@netlify
Copy link

netlify bot commented Feb 4, 2022

✔️ [V2]

🔨 Explore the source changes: fc995fd

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61fd2d02339d3d00077f004e

😎 Browse the preview: https://deploy-preview-6605--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 79
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 92

Lighthouse ran on https://deploy-preview-6605--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

Size Change: -731 B (0%)

Total Size: 771 kB

Filename Size Change
website/build/assets/js/main.********.js 582 kB -731 B (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 47.2 kB
website/build/assets/css/styles.********.css 105 kB
website/build/index.html 36.7 kB

compressed-size-action

@Josh-Cena Josh-Cena merged commit 45f6f8b into main Feb 4, 2022
@Josh-Cena Josh-Cena deleted the jc/eslint branch February 4, 2022 13:57
@slorber
Copy link
Collaborator

slorber commented Feb 4, 2022

not against but not sure what you mean by Export all is known to not work in ESM

Aren't we already using ESM before? 🤔 you mean node ESM?

@Josh-Cena
Copy link
Collaborator Author

Yes, native Node ESM. Node ESM is able to statically analyze CJS modules and find named exports, but if you use export all, the exported names will not be visible within the index file and therefore you can't do named 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 pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants