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

chore(deps): Update react markdown to latest #908

Merged
merged 5 commits into from
Jul 28, 2022

Conversation

darryltec
Copy link
Contributor

@darryltec darryltec commented Jul 26, 2022

Motivations

Update react markdown to latest so we can render it on storybook without it throwing

Uncaught TypeError: Object(...).cwd is not a function

Changes

Added

Changed

  • Updated react markdown to latest

Deprecated

Removed

Fixed

  • Storybook failing to render it

Security

Testing

  • Ensure it still works like before

Troubleshooting

Running jest would throw this error


    Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/en/ecmascript-modules for how to enable it.
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    /atlantis/packages/components/node_modules/react-markdown/index.js:6
    export {uriTransformer} from './lib/uri-transformer.js'
    ^^^^^^

    SyntaxError: Unexpected token 'export'

    > 1 | import ReactMarkdown from "react-markdown";
        | ^
      2 | import React, { DetailedHTMLProps, HTMLAttributes } from "react";
      3 | import { Text } from "../Text";
      4 | import { Emphasis } from "../Emphasis";

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)
      at Object.<anonymous> (packages/components/src/Markdown/Markdown.tsx:1:1)

Here's an explanation on why that happens remarkjs/react-markdown#635 (comment)

and the potential solutions for it remarkjs/react-markdown#635 (comment)


In Atlantis we use Github's built in pull request reviews.

Random photo of Atlantis

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 77015e2
Status: ✅  Deploy successful!
Preview URL: https://52f609ce.atlantis.pages.dev
Branch Preview URL: https://job-51200-chore-deps-update-.atlantis.pages.dev

View logs

Copy link
Contributor

@MichaelParadis MichaelParadis left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@lmorgan29 lmorgan29 left a comment

Choose a reason for hiding this comment

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

LGTM 😎

@darryltec darryltec merged commit b2da87b into master Jul 28, 2022
@darryltec darryltec deleted the JOB-51200-chore-deps-update-react-markdown-again branch July 28, 2022 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants