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

fix DoNotTranslation deserialization #16725

Merged
30 commits merged into from
Jul 22, 2024
Merged

fix DoNotTranslation deserialization #16725

30 commits merged into from
Jul 22, 2024

Conversation

tabathadelane
Copy link
Contributor

@tabathadelane tabathadelane commented Mar 29, 2024

this PR does two main things:

  • add upgraded versions of unified and related packages

    you can see these in code as unified11 or remark-parse10, etc. it would be a huge undertaking to upgrade everywhere we use these packages, so this numbering lets us use the upgraded versions only in specific places. upgrading these packages in our deserialization code fixes the newline issue with DNT tags. there were some other minor changes necessary to get deserialization working with the upgraded packages
  • add uvu and Sinon for ESM tests

    rather than desperately fight Jest to somehow get CJS and ESM tests working, this PR adds uvu specifically for running ESM tests. ESM tests are necessary as newer unified packages only have ESM support (no CJS), so our code has to be ESM as well. our test command now runs both Jest and uvu. one small note is that uvu does not support snapshot testing. i wrote a rudimentary module to accomplish this. i added Sinon for easier function mocking, as jest.fn can't be used outside of Jest

serialization code is unchanged with this PR. i tried to keep the scope as tight as possible, so this only updates deserialization code and other files that needed to be updated to ESM out of necessity

Copy link

Hi @tabathadelane 👋

Thanks for your pull request! Your PR is in a queue, and a writer will take a look soon. We generally publish small edits within one business day, and larger edits within three days.

We will automatically generate a preview of your request, and will comment with a link when the preview is ready (usually 10 to 20 minutes). If you add any more commits, you can comment netlify build on this PR to update the preview.

Copy link

netlify bot commented Mar 29, 2024

Deploy Preview for docs-website-netlify ready!

Name Link
🔨 Latest commit a12edfa
🔍 Latest deploy log https://app.netlify.com/sites/docs-website-netlify/deploys/6643931ee018a000086144f9
😎 Deploy Preview https://deploy-preview-16725--docs-website-netlify.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jeff-colucci jeff-colucci added the eng issues related to site functionality that requires engineering label Mar 29, 2024
tabathadelane and others added 24 commits April 22, 2024 17:59
`mdxJsxTextElement` is a node type elsewhere, but it doesn't work here
deserialization-helpers.js was using an older version of unified and
related packages, which was causing it not to recognize `mdxJsx*`
node types. upgrading in that file would've been difficult, because
it would've had to change to an ESM file, as would handlers.js,
and many more files in the dependency chain.
this is a decent workaround — just define the attribute processor in
deserialize-html.mjs, then pass it as an argument through to the
deserialization-helper functions

to get tests working, i had to add `TRANSLATION_TYPE=human` to the test
command, i wasn't able to get mocking the configuration module working
@sunnyzanchi sunnyzanchi force-pushed the tabatha/dnt-new-lines-2 branch from e6b40d1 to afe40e6 Compare April 22, 2024 21:59
@sunnyzanchi sunnyzanchi changed the title example de/serialization fix DoNotTranslation deserialization Apr 22, 2024
@sunnyzanchi sunnyzanchi force-pushed the tabatha/dnt-new-lines-2 branch from afe40e6 to effd4d0 Compare April 22, 2024 22:10
Copy link

netlify bot commented Apr 24, 2024

Deploy Preview for docs-website-kr ready!

Name Link
🔨 Latest commit a00f8dd
🔍 Latest deploy log https://app.netlify.com/sites/docs-website-kr/deploys/66293a89f8dbf9000876e9dc
😎 Deploy Preview https://deploy-preview-16725--docs-website-kr.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 24, 2024

Deploy Preview for docs-website-es failed. Why did it fail? →

Name Link
🔨 Latest commit a00f8dd
🔍 Latest deploy log https://app.netlify.com/sites/docs-website-es/deploys/66293a896a0619000856edff

Copy link

netlify bot commented Apr 24, 2024

Deploy Preview for docs-website-pt failed. Why did it fail? →

Name Link
🔨 Latest commit a00f8dd
🔍 Latest deploy log https://app.netlify.com/sites/docs-website-pt/deploys/66293a89071cc10008821199

@sunnyzanchi sunnyzanchi marked this pull request as ready for review April 24, 2024 17:01
@sunnyzanchi sunnyzanchi requested review from a team, sunnyzanchi and LizBaker and removed request for a team April 24, 2024 17:01
clarkmcadoo
clarkmcadoo previously approved these changes Apr 24, 2024
sunnyzanchi and others added 2 commits April 25, 2024 17:36
this ensures we keep brackets around MDX expressions
@austin-schaefer
Copy link
Contributor

Hi @tabathadelane , is this PR still something we're actively working on?

@sunnyzanchi sunnyzanchi closed this pull request by merging all changes into develop in fb106ec Jul 22, 2024
@sunnyzanchi sunnyzanchi deleted the tabatha/dnt-new-lines-2 branch July 22, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eng issues related to site functionality that requires engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants