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: add support for updated react version [TOL-2633] #756

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

YvesRijckaert
Copy link
Contributor

@YvesRijckaert YvesRijckaert commented Dec 9, 2024

Add support for projects with react version 19 for rich text react renderer package
We do not upgrade the dev dependency of React for this package since snapshot tests are failing with the new version. It is blocked until this is fixed: jestjs/jest#15402

Testing

  • Next version 14 with React 18 and pages router
  • Next version 14 with React 18 and app router
  • Next version 15 with React 19 and pages router
  • Next version 15 with React 19 and app router

@YvesRijckaert YvesRijckaert requested a review from a team December 9, 2024 12:46
@YvesRijckaert YvesRijckaert marked this pull request as draft December 9, 2024 12:48
@elylucas
Copy link
Member

elylucas commented Dec 9, 2024

@YvesRijckaert this is currently blocking installing Studio SDK (which has a dep on rich-text-react-renderer) into new Next.js v15 apps. Not an emergency, just an FYI.

@chrishelgert
Copy link
Contributor

is it only blocked by the snapshots? could be maybe update the tests to not use snapshots instead? 🤔

@2wce
Copy link
Contributor

2wce commented Dec 10, 2024

We can probably also switch to vitest since we are using it in our other libraries

@chrishelgert
Copy link
Contributor

chrishelgert commented Dec 10, 2024

We can probably also switch to vitest since we are using it in our other libraries

We still have jest as adopt on the tech radar, if we would like to switch to vitest, we should do this more generally and bring it up in the chapter meeting

Tomorrow would be one ;)

@YvesRijckaert YvesRijckaert changed the title chore: update react version chore: update react version [TOL-2633] Dec 11, 2024
@YvesRijckaert YvesRijckaert force-pushed the chore/update-react-version branch from a84d79c to 0dd7456 Compare December 11, 2024 10:47
@YvesRijckaert YvesRijckaert changed the title chore: update react version [TOL-2633] chore: add support for updated react version [TOL-2633] Dec 11, 2024
@contentful-automation
Copy link
Contributor

Size Change: 0 B

Total Size: 75.4 kB

ℹ️ View Unchanged
Filename Size Change
./packages/contentful-slatejs-adapter/dist/contentful-slatejs-adapter.es5.js 2.48 kB 0 B
./packages/contentful-slatejs-adapter/dist/lib/__test__/contentful-helpers.js 344 B 0 B
./packages/contentful-slatejs-adapter/dist/lib/__test__/contentful-to-slatejs-adapter.test.js 2.09 kB 0 B
./packages/contentful-slatejs-adapter/dist/lib/contentful-to-slatejs-adapter.js 858 B 0 B
./packages/contentful-slatejs-adapter/dist/lib/helpers.js 156 B 0 B
./packages/contentful-slatejs-adapter/dist/lib/index.js 142 B 0 B
./packages/contentful-slatejs-adapter/dist/lib/schema.js 516 B 0 B
./packages/contentful-slatejs-adapter/dist/lib/slatejs-to-contentful-adapter.js 1.02 kB 0 B
./packages/contentful-slatejs-adapter/dist/lib/types/index.js 64 B 0 B
./packages/contentful-slatejs-adapter/dist/lib/types/slate.js 88 B 0 B
./packages/rich-text-from-markdown/dist/lib/__test__/helpers.js 620 B 0 B
./packages/rich-text-from-markdown/dist/lib/__test__/index.test.js 2.38 kB 0 B
./packages/rich-text-from-markdown/dist/lib/__test__/real-world.test.js 2.63 kB 0 B
./packages/rich-text-from-markdown/dist/lib/index.js 4 kB 0 B
./packages/rich-text-from-markdown/dist/lib/types/index.js 125 B 0 B
./packages/rich-text-from-markdown/dist/rich-text-from-es5.js 4.43 kB 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/embedded-entry.js 309 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/embedded-js 316 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/heading.js 320 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/hr.js 258 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/hyperlink.js 311 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/index.js 602 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/inline-entity.js 377 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/invalid-marks.js 284 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/invalid-type.js 316 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/mark.js 274 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/ol.js 320 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/paragraph.js 245 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/quote.js 257 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/table-header.js 412 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/table.js 401 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/documents/ul.js 321 B 0 B
./packages/rich-text-html-renderer/dist/lib/__test__/index.test.js 2.21 kB 0 B
./packages/rich-text-html-renderer/dist/lib/index.js 1.77 kB 0 B
./packages/rich-text-html-renderer/dist/rich-text-html-es5.js 2.22 kB 0 B
./packages/rich-text-links/dist/lib/__test__/index.test.js 2.19 kB 0 B
./packages/rich-text-links/dist/lib/index.js 1.62 kB 0 B
./packages/rich-text-links/dist/lib/types/utils.js 124 B 0 B
./packages/rich-text-links/dist/rich-text-links.es5.js 1.59 kB 0 B
./packages/rich-text-plain-text-renderer/dist/lib/__test__/index.test.js 955 B 0 B
./packages/rich-text-plain-text-renderer/dist/lib/index.js 1.27 kB 0 B
./packages/rich-text-plain-text-renderer/dist/rich-text-plain-text-es5.js 1.24 kB 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/components/js 287 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/components/Paragraph.js 287 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/components/Strong.js 287 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/embedded-entry.js 309 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/embedded-js 316 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/heading.js 320 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/hr.js 258 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/hyperlink.js 311 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/index.js 662 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/inline-entity.js 377 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/invalid-marks.js 284 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/invalid-type.js 316 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/mark.js 274 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/multi-mark.js 289 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/ol.js 320 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/paragraph.js 245 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/quote.js 257 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/table-header.js 412 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/table.js 401 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/documents/ul.js 321 B 0 B
./packages/rich-text-react-renderer/dist/lib/__test__/index.test.js 2.75 kB 0 B
./packages/rich-text-react-renderer/dist/lib/index.js 1.27 kB 0 B
./packages/rich-text-react-renderer/dist/lib/util/appendKeyToValidElement.js 259 B 0 B
./packages/rich-text-react-renderer/dist/lib/util/nodeListToReactComponents.js 843 B 0 B
./packages/rich-text-react-renderer/dist/rich-text-react-es5.js 2.26 kB 0 B
./packages/rich-text-types/dist/__test__/schemaConstraints.test.js 686 B 0 B
./packages/rich-text-types/dist/__test__/validation.test.js 2.34 kB 0 B
./packages/rich-text-types/dist/blocks.js 487 B 0 B
./packages/rich-text-types/dist/emptyDocument.js 356 B 0 B
./packages/rich-text-types/dist/helpers.js 475 B 0 B
./packages/rich-text-types/dist/index.js 6.39 kB 0 B
./packages/rich-text-types/dist/inlines.js 460 B 0 B
./packages/rich-text-types/dist/marks.js 317 B 0 B
./packages/rich-text-types/dist/nodeTypes.js 127 B 0 B
./packages/rich-text-types/dist/schemaConstraints.js 1.09 kB 0 B
./packages/rich-text-types/dist/types.js 124 B 0 B
./packages/rich-text-types/dist/validator/assert.js 1.72 kB 0 B
./packages/rich-text-types/dist/validator/errors.js 738 B 0 B
./packages/rich-text-types/dist/validator/index.js 1.29 kB 0 B
./packages/rich-text-types/dist/validator/node.js 1.51 kB 0 B
./packages/rich-text-types/dist/validator/path.js 486 B 0 B
./packages/rich-text-types/dist/validator/text.js 447 B 0 B

@YvesRijckaert
Copy link
Contributor Author

Update: I've delayed updating react internally in rich text renderer until the jest issue has been fixed. Migrating away from snapshots would have been a huge task because there are over 30 tests using snapshots.

I tested it with just updating peerDependencies and everything worked ok

@YvesRijckaert YvesRijckaert marked this pull request as ready for review December 11, 2024 13:15
@YvesRijckaert YvesRijckaert merged commit ed63c1a into master Dec 11, 2024
5 checks passed
@YvesRijckaert YvesRijckaert deleted the chore/update-react-version branch December 11, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Snapshot tests failing for React 19
4 participants