Skip to content

[chore] Unplugin v2 - #190

Merged
yoannmoinet merged 9 commits into
v3from
yoann/unplugin-v2
Jul 28, 2025
Merged

[chore] Unplugin v2#190
yoannmoinet merged 9 commits into
v3from
yoann/unplugin-v2

Conversation

@yoannmoinet

Copy link
Copy Markdown
Member

Upgrade to Unplugin v2

Summary

Upgrades to Unplugin v2, migrating from deprecated APIs to the new filter/handler pattern for better performance.

Changes

Unplugin v2 Migration

  • Migrated loadIncludeload.filter with RegExp pattern in injection plugin
  • Migrated transformIncludetransform.filter with include/exclude arrays in RUM privacy plugin
  • Updated wrapPlugins helper to handle both function and object hooks
  • Removed deprecated hook names from UNPLUGIN_HOOKS array

Testing & Documentation

  • Expanded test coverage for Unplugin v2 object hooks with filters
  • Updated plugin creation templates to showcase new filter patterns
  • Added comprehensive examples of filter types (RegExp, include/exclude, string patterns)

Breaking Changes

Plugins using loadInclude/transformInclude must migrate to filter/handler pattern.

Migration Example

// Before
{
  loadInclude(id) { return id.includes('virtual'); },
  load(id) { return { code: 'content' }; }
}

// After
{
  load: {
    filter: { id: /virtual/ },
    handler(id) { return { code: 'content' }; }
  }
}

@yoannmoinet yoannmoinet added the v3 label Jul 22, 2025
Base automatically changed from yoann/drop-webpack-4 to v3 July 23, 2025 13:24
@yoannmoinet yoannmoinet mentioned this pull request Jul 23, 2025
Merged
11 tasks
@yoannmoinet
yoannmoinet marked this pull request as ready for review July 23, 2025 13:36
@yoannmoinet
yoannmoinet requested a review from a team as a code owner July 23, 2025 13:36

@cy-moi cy-moi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! Privacy plugin side LGTM!

@sethfowler-datadog sethfowler-datadog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thank you for making this happen.

@yoannmoinet
yoannmoinet merged commit 83a7896 into v3 Jul 28, 2025
4 checks passed
@yoannmoinet
yoannmoinet deleted the yoann/unplugin-v2 branch July 28, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants