Skip to content

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

Merged
slorber merged 1 commit into
masterfrom
slorber/transpile-some-libs
May 14, 2021
Merged

fix(v2): transpile libs with too recent syntax with babel#4789
slorber merged 1 commit into
masterfrom
slorber/transpile-some-libs

Conversation

@slorber

@slorber slorber commented May 14, 2021

Copy link
Copy Markdown
Collaborator

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

netlify Bot commented May 14, 2021

Copy link
Copy Markdown

[V1]

Built with commit 0410466

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

@netlify

netlify Bot commented May 14, 2021

Copy link
Copy Markdown

[V2]

Built with commit 0410466

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

@github-actions

Copy link
Copy Markdown

⚡️ 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
Copy Markdown

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

slorber commented May 14, 2021

Copy link
Copy Markdown
Collaborator Author

works on Edge 18 now

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

tony commented Jul 24, 2021

Copy link
Copy Markdown
Contributor

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

slorber commented Jul 24, 2021

Copy link
Copy Markdown
Collaborator Author

@tony without repro I can't do anything

@tony

tony commented Jul 24, 2021

Copy link
Copy Markdown
Contributor

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

@slorber
slorber deleted the slorber/transpile-some-libs branch August 17, 2021 17:49
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
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