Skip to content

Conversation

@DmitrySharabin
Copy link
Contributor

@DmitrySharabin DmitrySharabin commented Oct 10, 2025

Summary

  • Add utils authored by @LeaVerou: isObject(), isPlainObject(), deepMerge(), deepClone(), betterAssign(),insert(), and insertAfter(). Update insertBefore() accordingly.
  • Update extend() to support new special properties ($insertBefore, insertAfter, $insert, $delete, and $merge) that allow defining grammars more declaratively and adding a new grammarPatch() util (all authored by @LeaVerou). See [v2] Language combinations / extensions / embeddings / ... #3927 for details.
  • Adjust TS types and config to support the new API.
  • Fix TS errors.

Those are non-breaking changes. Corresponding changes to language definitions are in a separate PR.


This is part 2 of 3 in a stack made with GitButler:

@github-actions
Copy link

github-actions bot commented Oct 10, 2025

No JS Changes

Generated by 🚫 dangerJS against f1faac8

@netlify
Copy link

netlify bot commented Oct 10, 2025

Deploy Preview for dev-prismjs-com ready!

Name Link
🔨 Latest commit f1faac8
🔍 Latest deploy log https://app.netlify.com/projects/dev-prismjs-com/deploys/68ed4d45a82c3d0008c75174
😎 Deploy Preview https://deploy-preview-4019--dev-prismjs-com.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 project configuration.

@DmitrySharabin DmitrySharabin force-pushed the grammar-patch branch 2 times, most recently from 538eaec to 3328581 Compare October 10, 2025 15:47
return source;
}

return source ?? target;
Copy link
Contributor Author

@DmitrySharabin DmitrySharabin Oct 13, 2025

Choose a reason for hiding this comment

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

I updated this part to handle the $merge special property correctly. Before, it was target ?? source, and we couldn't merge numbers, strings, regexes, etc.

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.

1 participant