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

Switch internals to Mdx 🦜 #1720

Closed
wants to merge 111 commits into from
Closed

Switch internals to Mdx 🦜 #1720

wants to merge 111 commits into from

Conversation

sapegin
Copy link
Member

@sapegin sapegin commented Nov 26, 2020

Overview

  • Mdx is now used to parse and render Markdown files (src/loaders/mdx-loader.ts).
  • Most of the Markdown processing is done using Mdx (Rehype) plugins (src/loaders/rehype/*).
  • We still render Markdown in comments using markdown-to-jsx. Many comments aren't written as Markdown and contain things like imports that would be treated as JavaScript by Mdx. markdown-to-jsx is about 5 KB so it's okay to continue using it.
  • Most of the src/client/rsg-components/mdx/Mdx* components are migrated from the old Markdown components without any changes, and they are used for rendering both: Mdx and Markdown (markdown-to-jsx).
  • Mdx is used to parse modifiers in fenced code blocks, so JSON modifiers are no longer supported.

Todo

  • Render Markdown files using Mdx
  • Migrate Markdown components to Mdx
  • Render code editor / playground via Mdx
  • Support import/require in the code examples
  • Provide imports in Mdx files to the code examples
  • Provide the current component in the code example scope
  • Support context config option
  • Suport static modifier
  • Support noeditor modifier
  • Support padded modifier
  • Support custom modifiers
  • Support exampleMode
  • Syntax highlight in static mode using Mdx, on the client side
  • Use prism-react-renderer for syntax highlight in the editor
  • Allow components customization of Mdx via style guide config
  • Replace example-loader with the new mdx-loader
  • Remove defaultExample option
  • Make the original Markdown component reuse Mdx components
  • Support CSF stories
    • Basic support of CSF stories (only named export with an arrow function)
    • Support more use cases for CSF stories exports
    • Suport imports in CSF stories
    • Support local variables in CSF stories
    • CSF stories hot reload
    • TypeScript and ECMAScript Next support (CSF files support: TypeScript and ECMAScript Next support #1748)
    • Isolation mode for examples imported CSF files
  • Simplify migration from Storybook: provide @storybook/addon-docs/blocks component alternatives:
    • Preview
    • Story
    • Props
    • Source
    • Description
    • Meta
  • Simplify importing of aforementioned components
  • Clean up todo comments
  • Fix types
  • Fix tests
  • Update docs

Regressions

  • Syntax highlight in Markdown in component descriptions
  • Remove bullets on checkbox lists in Markdown
  • Style details/summary in Markdown
  • Isolated mode for particular examples (missing example index, showing just one example from Mdx file)
  • No content in non-component Markdown files
  • The editor cursor is in the wrong place when there's a tab character in the code

Removed functionality

  • defaultExample config option is no longer supported.
  • Undocumented section content as a function returning the content is no longer supported.
  • JSON modifiers (```js { "props": { "className": "checks" } }) are no longer supported, a new simplified format: ```js noeditor class=checks.

@sapegin sapegin mentioned this pull request Dec 4, 2020
@styleguidist styleguidist deleted a comment from lgtm-com bot Dec 4, 2020
@styleguidist styleguidist deleted a comment from lgtm-com bot Dec 4, 2020
sapegin and others added 17 commits December 9, 2020 08:41
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/mikaelbr/node-notifier/releases)
- [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md)
- [Commits](mikaelbr/node-notifier@v8.0.0...v8.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Still not working in non-component documents though.
@stale
Copy link

stale bot commented Apr 16, 2022

😴 This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week without any further activity. Consider opening a pull request if you still have this issue or want this feature.

@stale stale bot added the wontfix label Apr 16, 2022
@stale stale bot closed this Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants