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

Remove usage of resolve library #12860

Open
AbhiPrasad opened this issue Jul 10, 2024 · 3 comments
Open

Remove usage of resolve library #12860

AbhiPrasad opened this issue Jul 10, 2024 · 3 comments
Labels
Meta: Good First Issue Package: nextjs Issues related to the Sentry Nextjs SDK

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Jul 10, 2024

Problem Statement

The SDK requires Node 14.18+ as per

This means we can replace resolve library with native Node.js usage.

Solution Brainstorm

Instead of using resolve, we can use import { createRequire } from 'module';. This is fine because we only need CJS resolution here.

See rollup/plugins#1742 as an example PR doing this.

@AbhiPrasad
Copy link
Member Author

This eliminates 5 deps / 225 KB from the dep tree of the SDK: https://npmgraph.js.org/?q=resolve

@AbhiPrasad
Copy link
Member Author

Looks like this does need esm resolution support!

We might need https://github.com/unjs/mlly instead

@Zen-cronic
Copy link
Contributor

just a heads up @AbhiPrasad, mlly has a relatively similar dep graph and size to resolve.

5 deps: https://npmgraph.js.org/?q=mlly
232 kB: https://www.npmjs.com/package/mlly/v/1.7.1?activeTab=readme

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Aug 9, 2024
@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 Aug 9, 2024
@AbhiPrasad AbhiPrasad added this to the 9.0.0 milestone Nov 1, 2024
@lforst lforst removed this from the 9.0.0 milestone Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta: Good First Issue Package: nextjs Issues related to the Sentry Nextjs SDK
Projects
Status: No status
Development

No branches or pull requests

4 participants