Skip to content

prism: Fix crash when className prop is missing#2322

Merged
hasparus merged 1 commit intodevelopfrom
prism-fix-empty-classname
Sep 18, 2022
Merged

prism: Fix crash when className prop is missing#2322
hasparus merged 1 commit intodevelopfrom
prism-fix-empty-classname

Conversation

@lachlanjc
Copy link
Member

@lachlanjc lachlanjc commented Sep 15, 2022

Fixes #2016

Version

Published prerelease version: v0.15.0-develop.27

Changelog

🎉 This release contains work from new contributors! 🎉

Thanks for all your work!

❤️ Luke Watts (@thisislawatts)

❤️ Valto Savi (@pointlessrapunzel)

Release Notes

Pull out MDX to be opt-in (#2288)

Breaking: theme-ui no longer includes @theme-ui/mdx — MDX is now opt-in.

If your project is not using MDX or importing Themed, you shouldn't need to
change anything.

  • MDXProvider is no longer included in Theme UI ThemeProvider, and has been
    removed in favour of an useThemedStylesWithMdx hook.

    • Migration: Use useThemedStylesWithMdx together with MDXProvider and useMDXComponents from @mdx-js/react.

      import {
        MDXProvider,
        useMDXComponents,
        Components as MDXComponents,
        MergeComponents as MergeMDXComponents,
      } from '@mdx-js/react'
      import { useThemedStylesWithMdx } from '@theme-ui/mdx'
      import { ThemeProvider, Theme } from 'theme-ui'
      
      interface MyProviderProps {
        theme: Theme
        components?: MDXComponents | MergeMDXComponents
        children: React.ReactNode
      }
      function MyProvider({ theme, components, children }: MyProviderProps) {
        const componentsWithStyles = useThemedStylesWithMdx(useMDXComponents(components))
      
        return (
          <ThemeProvider theme={theme}>
            <MDXProvider components={componentsWithStyles}>
              {children}
            </MDXProvider>
          </ThemeProvider>
        )
      }
  • Themed components dict and other exports from @theme-ui/mdx are no longer reexported from theme-ui.

    • Migration: Import it from @theme-ui/mdx instead.

      -  import { Themed } from 'theme-ui'
      +  import { Themed } from '@theme-ui/mdx'

Remove @theme-ui/editor (#2292)

  • Breaking: @theme-ui/editor was removed. Use CSS GUI instead.

Drop support for React 16 + 17 (#2215)

Theme UI 0.15.0 drops support for React 16 and React 17. Your use case may still work, but we don't guarantee it.


🚀 Enhancement

🐛 Bug Fix

👨‍💻 Minor changes

🏠 Internal

Authors: 6

@lachlanjc lachlanjc requested a review from hasparus as a code owner September 15, 2022 20:41
@vercel
Copy link

vercel bot commented Sep 15, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
theme-ui ✅ Ready (Inspect) Visit Preview Sep 15, 2022 at 8:44PM (UTC)

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5223ee5:

Sandbox Source
next-theme-ui-example Configuration
gatsby-plugin-theme-ui-example Configuration
theme-ui-prism-crash Issue #2016

Copy link
Member

@hasparus hasparus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@hasparus hasparus merged commit eb802b5 into develop Sep 18, 2022
@hasparus hasparus deleted the prism-fix-empty-classname branch September 18, 2022 14:19
@hasparus hasparus added the prerelease This change is available in a prerelease. label Sep 18, 2022
@hasparus
Copy link
Member

🚀 PR was released in v0.15.0 🚀

@hasparus hasparus added released This issue/pull request has been released. and removed prerelease This change is available in a prerelease. labels Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prism: Cannot read properties of undefined (reading 'replace')

2 participants