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): bump react-markdown from 8.0.7 to 9.0.0 #578

Closed

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 28, 2023

Bumps react-markdown from 8.0.7 to 9.0.0.

Release notes

Sourced from react-markdown's releases.

9.0.0

Change

  • b67d714 Change to require Node.js 16 migrate: update too
  • ec2b134 Change to require React 18 migrate: update too
  • bf5824f Change to use exports migrate: don’t use private APIs
  • c383a45 Update @types/hast, utilities, plugins, etc migrate: update too
  • eca5e6b 08ead9e Replace transformImageUri, transformLinkUri w/ urlTransform migrate: see Add urlTransform
  • de29396 Remove linkTarget option by @​galabra in remarkjs/react-markdown#762 migrate: see Remove linkTarget
  • 4346276 Remove support for passing custom props to components migrate: see Remove includeElementIndex, Remove rawSourcePos, Remove sourcePos, Remove extra props passed to certain components
  • c0dfbd6 Remove UMD bundle from package migrate: use esm.sh or a CDN or so
  • e12b5e9 Remove prop-types migrate: use TypeScript
  • 4eb7aa0 Change to throw errors for removed props migrate: don’t pass options that don’t do things
  • 8aabf74 Change to improve error messages migrate: expect better messages

Full Changelog: remarkjs/react-markdown@8.0.7...9.0.0

Changelog

Sourced from react-markdown's changelog.

9.0.0 - 2023-09-27

  • b67d714 Change to require Node.js 16
    migrate: update too
  • ec2b134 Change to require React 18
    migrate: update too
  • bf5824f Change to use exports
    migrate: don’t use private APIs
  • c383a45 Update @types/hast, utilities, plugins, etc
    migrate: update too
  • eca5e6b 08ead9e Replace transformImageUri, transformLinkUri w/ urlTransform
    migrate: see “Add urlTransform” below
  • de29396 Remove linkTarget option
    migrate: see “Remove linkTarget” below
  • 4346276 Remove support for passing custom props to components
    migrate: see “Remove includeElementIndex”, “Remove rawSourcePos”, “Remove sourcePos”, “Remove extra props passed to certain components” below
  • c0dfbd6 Remove UMD bundle from package
    migrate: use esm.sh or a CDN or so
  • e12b5e9 Remove prop-types
    migrate: use TypeScript
  • 4eb7aa0 Change to throw errors for removed props
    migrate: don’t pass options that don’t do things
  • 8aabf74 Change to improve error messages
    migrate: expect better messages

Add urlTransform

The transformImageUri and transformLinkUri were removed. Having two functions is a bit much, particularly because there are more URLs you might want to change (or which might be unsafe so we make them safe). And their name and APIs were a bit weird. You can use the new urlTransform prop instead to change all your URLs.

Remove linkTarget

The linkTarget option was removed; you should likely not set targets.

... (truncated)

Commits
  • 6360bc2 9.0.0
  • 72e68d2 Add docs on line endings
  • b67d714 Change to require Node.js 16
  • bf5824f Change to use exports
  • d056940 Refactor docs
  • 08ead9e Refactor to improve safe URL detection
  • a1fc6d9 Refactor package.json some more
  • eca5e6b Replace transformImageUri, transformLinkUri w/ urlTransform
  • ec2b134 Change to require React 18
  • c0dfbd6 Remove UMD bundle from package
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [react-markdown](https://github.com/remarkjs/react-markdown) from 8.0.7 to 9.0.0.
- [Release notes](https://github.com/remarkjs/react-markdown/releases)
- [Changelog](https://github.com/remarkjs/react-markdown/blob/main/changelog.md)
- [Commits](remarkjs/react-markdown@8.0.7...9.0.0)

---
updated-dependencies:
- dependency-name: react-markdown
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Sep 28, 2023
@github-actions
Copy link

Test Results

    8 files  +    2      8 suites  +2   1h 0m 47s ⏱️ + 19m 28s
  59 tests ±    0    57 ✔️  -     1  1 💤 ±0  1 +1 
468 runs  +117  459 ✔️ +114  8 💤 +2  1 +1 

For more details on these failures, see this check.

Results for commit c645dc6. ± Comparison against base commit 537bd3f.

@hawtio-ci
Copy link

hawtio-ci bot commented Sep 28, 2023

Test results

Run attempt: 481
Detailed summary

NAME TESTS PASSED ✅ SKIPPED 💤 FAILED ❌ ERRORS 🚫 TIME 🕖
results-quarkus-node(16)-java(11)-firefox 59 57 1 1 0 493.099
results-quarkus-node(16)-java(17)-firefox 59 58 1 0 0 469.115
results-quarkus-node(18)-java(11)-firefox 59 58 1 0 0 385.441
results-quarkus-node(18)-java(17)-firefox 59 58 1 0 0 457.955
results-springboot-node(16)-java(11)-firefox 58 57 1 0 0 512.644
results-springboot-node(16)-java(17)-firefox 58 57 1 0 0 475.875
results-springboot-node(18)-java(11)-firefox 58 57 1 0 0 399.936
results-springboot-node(18)-java(17)-firefox 58 57 1 0 0 453.081

@phantomjinx phantomjinx self-assigned this Sep 29, 2023
@phantomjinx
Copy link
Member

This is proving a hard fix to find.

The problem:

 FAIL  src/Hawtio.test.tsx
  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • 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/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /home/phantomjinx/programming/js/hawtio-next/node_modules/react-markdown/index.js:11
    export {Markdown as default, defaultUrlTransform} from './lib/index.js'
    ^^^^^^

    SyntaxError: Unexpected token 'export'

      13 | } from '@patternfly/react-core'
      14 | import React from 'react'
    > 15 | import Markdown from 'react-markdown'
         | ^
      16 | import { NavLink, Navigate, Route, Routes, useLocation } from 'react-router-dom'
      17 | import help from './help.md'
      18 | import { helpRegistry } from './registry'

      at Runtime.createScriptFromCode (../../node_modules/jest/node_modules/jest-runtime/build/index.js:1505:14)
      at Object.<anonymous> (src/help/HawtioHelp.tsx:15:1)
      at Object.<anonymous> (src/ui/page/HawtioPage.tsx:3:1)
      at Object.<anonymous> (src/ui/page/index.ts:1:1)
      at Object.<anonymous> (src/Hawtio.tsx:6:1)
      at Object.<anonymous> (src/Hawtio.test.tsx:2:1)

Various attempts at solving similar issues are dotted around the interwebs. However, none of the most popular solutions or workarounds resolve the issue in our case:

  • Mock the Markdown component: attempt to do this results in the syntax of the mock being illegal. This might still be the most workable solution if only to get the syntax of the component correct;
  • Add a negative regex to jest.config.ts to not ignore react-markdown seems to be completely ignored:
  transformIgnorePatterns: [
    'node_modules/(?!@patternfly/react-icons/dist/esm/icons)/',
    'node_modules/(?!(devlop)/)',
    'node_modules/(?!(react-markdown)/)'
  ]
  • Trying in conjunction with a custom transform call, similarly causes the same error:
   transform: {
      '\\.[jt]sx?$': 'ts-jest',
     'node_modules/devlop/.+\\.(j|t)s?$': 'ts-jest',
     'node_modules/react-markdown/.+\\.(j|t)s?$': 'ts-jest'
   },

Interestingly, the devlop entry had to be added once the transform option was introduced. A similar error complaining about devlop appeared. By adding the entry to both transformIgnorePatterns and transform, the devlop error went away, only to be replaced by the react-markdown error.

Not sure where we go from here but upgrading to react-markdown and getting jest to play nicely with it is problematic. However, on the plus-side, actually compiling and starting the test app seems to work fine, with the Help markdown rendering without any trouble.

@tadayosi
Copy link
Member

tadayosi commented Oct 3, 2023

@phantomjinx Thanks for the analysis. Then let's move it to a separate issue #587 and address it there. I'm closing this for now.

@dependabot ignore this major version

@dependabot dependabot bot closed this Oct 3, 2023
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Oct 3, 2023

OK, I won't notify you about version 9.x.x again, unless you re-open this PR.

@dependabot dependabot bot deleted the dependabot/npm_and_yarn/react-markdown-9.0.0 branch October 3, 2023 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants