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

big package dependency updates for node 22 #298

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

alasdairwilson
Copy link
Collaborator

@alasdairwilson alasdairwilson commented Jan 10, 2025

Upgrade a large number of deps for node 22, react 19 and next 15 compatibility. Would be good if this was ranh locally by someone else incase I have missed something obvious in terms of a broken feature.

  • Migrated to our own copytoclipboard component to remove react-copy-to-clipboard due to deprecation

  • Fixes various issues in react-markdown due to changes to the way props are passed into plugins.

  • The package update introduced an additional bug in TOC parsing so this also fixes bugs in TOC (closes [bug]: display of sidebar TOC #294 ), both these issues were hard to fix due to the being generated from the material but the intersection observers being linked to the actual h2 elements. When Latex code is included this becomes hard to match for both the anchor links and the intersection observers.

    • The fixes involve util functions that can retrieve the material
    • The first, for the TOC intersection can generate the original heading from the textContent prop on the child node, this randomly is triplicated such that "$ABC$ title" becomes "ABCABCABC title" due to the way the katex makes the spans so the text is "detriplicated" looking for these repeated strings.
    • Sadly, we do not have access to textContent when generating ids so instead we search the node tree of the heading for text and then detriplicate the reconstructed textcontent string.
  • Replaces recoil (which is now archived) with jotai (closes Migrate from recoil #296 ), a surprisingly easy migration.

  • Fixes display of falink on same line as corresponding heading (why react 19 broke this I have no idea)

  • Fixes additional bug in TOC due to presence of backticks rendering the headings as [object Object]

@alasdairwilson alasdairwilson marked this pull request as ready for review January 14, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate from recoil [bug]: display of sidebar TOC
1 participant