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

feat: Add compiler option, replace Buble with Sucrase #1700

Merged
merged 21 commits into from Nov 12, 2020
Merged

feat: Add compiler option, replace Buble with Sucrase #1700

merged 21 commits into from Nov 12, 2020

Conversation

sapegin
Copy link
Member

@sapegin sapegin commented Oct 8, 2020

  1. Replace Bublé with Sucrase: faster, supports more ECMAScript features, like imports (we used to transpile them ourselves), optional chaining, class fields, etc.

  2. Allow custom compilers, like Babel or TypeScript using the new compilerModule and compileExample option.

Closes #462

New docs preview

https://deploy-preview-1700--styleguidist.netlify.app/docs/configuration#compilermodule

https://deploy-preview-1700--styleguidist.netlify.app/docs/configuration#compileexample

@styleguidist styleguidist deleted a comment from lgtm-com bot Oct 21, 2020
@sapegin sapegin added this to the 12.0.0: Customizable compiler milestone Oct 21, 2020
@codecov
Copy link

codecov bot commented Oct 21, 2020

Codecov Report

Merging #1700 (9cf39bb) into next (2b7bfe2) will decrease coverage by 0.69%.
The diff coverage is 78.87%.

Impacted Files Coverage Δ
src/loaders/utils/getComponents.ts 100.00% <ø> (ø)
src/loaders/utils/resolveESModule.ts 100.00% <ø> (ø)
src/loaders/styleguide-loader.ts 97.36% <50.00%> (ø)
src/scripts/utils/findFileCaseInsensitive.ts 80.00% <57.14%> (-20.00%) ⬇️
src/scripts/create-server.ts 66.66% <62.50%> (-22.23%) ⬇️
src/scripts/schemas/config.ts 85.29% <66.66%> (-3.04%) ⬇️
...lient/rsg-components/ReactExample/ReactExample.tsx 83.33% <70.00%> (-16.67%) ⬇️
src/client/utils/insertReturnLastExpression.ts 83.33% <83.33%> (ø)
src/client/rsg-components/Preview/Preview.tsx 97.29% <100.00%> (-0.14%) ⬇️
src/client/utils/compileCode.ts 100.00% <100.00%> (ø)
... and 5 more

@sapegin sapegin marked this pull request as ready for review October 21, 2020 11:13
docs/Configuration.md Show resolved Hide resolved
docs/Configuration.md Outdated Show resolved Hide resolved
@sapegin sapegin changed the base branch from master to next November 11, 2020 16:33
@sapegin sapegin merged commit 22bf140 into next Nov 12, 2020
@sapegin sapegin deleted the compiler branch November 12, 2020 07:02
@jchenevarin
Copy link

Hello guys, I've been looking for these commits in one of the releases to try that out but couldn't find them. Could you confirm me that with @11.2.0 it's still not possible to have typescript example in markdown and in that case could you point me towards the version containing these commits? thanks a lot

@sapegin
Copy link
Member Author

sapegin commented May 4, 2022

@a-maggi
Copy link

a-maggi commented Sep 15, 2022

Hey @sapegin, I'm getting this following error with that alpha version. Do I need to set something additional?

export 'mdx' (imported as 'mdx') was not found in '@mdx-js/react' (possible exports: MDXContext, MDXProvider, useMDXComponents, withMDXComponents)

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.

Create an option for a compiler
4 participants