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

fix(v2): transpile libs with too recent syntax with babel #4789

Merged
merged 1 commit into from
May 14, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented May 14, 2021

Motivation

Some libs (many from Sindre Sorhus) use too recent ES syntax and should be transpiled with Babel

copy-text-to-clipboard contains try {} catch {} for example

Not doing this means we have some older browsers (like Edge 18 released in nov 2018) not supported while it could easily.

Noticed this while testing browser support of Docusaurus in #4766

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

preview + inspecting JS output + testing on Edge 18

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label May 14, 2021
@slorber slorber requested a review from lex111 as a code owner May 14, 2021 08:05
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 14, 2021
@netlify
Copy link

netlify bot commented May 14, 2021

[V1]

Built with commit 0410466

https://deploy-preview-4789--docusaurus-1.netlify.app

@netlify
Copy link

netlify bot commented May 14, 2021

[V2]

Built with commit 0410466

https://deploy-preview-4789--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 88
🟢 Accessibility 96
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

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

@github-actions
Copy link

Size Change: -31 B (0%)

Total Size: 660 kB

Filename Size Change
website/build/assets/js/main.********.js 483 kB -31 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 88.5 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 62 kB 0 B
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 26.9 kB 0 B

compressed-size-action

@slorber
Copy link
Collaborator Author

slorber commented May 14, 2021

works on Edge 18 now

@slorber slorber merged commit c8812cf into master May 14, 2021
@tony
Copy link
Contributor

tony commented Jul 24, 2021

Unknown if this is related, but when updating from docusaurus 2.0.0-beta.0 to 2.0.0-beta.1, I get this with yarn build and yarn serve;

Uncaught (in promise) ReferenceError: exports is not defined

image

@echarles got a similar error in #5142

Not sure if this is related to my personal configuration, changes to webpack, this PR, or somewhere else. There's a lot of action going on

edit: Narrow it down from beta 0 -> beta 3 to beta 0 -> beta 1

@slorber
Copy link
Collaborator Author

slorber commented Jul 24, 2021

@tony without repro I can't do anything

@tony
Copy link
Contributor

tony commented Jul 24, 2021

@slorber no problem. If I narrow it down I'll make an issue

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: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants