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

feat(tracing): allow direct pg module to enable esbuild support #9227

Merged
merged 2 commits into from Oct 12, 2023

Conversation

aldenquimby
Copy link
Contributor

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Background

Proposal

Alternatives

  • If there's a way to configure esbuild similar to the webpack commonjsMagicComments, that should do the trick
  • However the proposed solution in this PR seems more robust, especially as more bundlers/minifiers are gaining traction

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Thanks @aldenquimby!

packages/tracing/test/integrations/node/postgres.test.ts Outdated Show resolved Hide resolved
__DEBUG_BUILD__ && logger.error("Postgres Integration was unable to access 'pg-native' bindings.");
return;
}

const { Client } = this._usePgNative ? pkg.native : pkg;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pkg.native?.Client is now nullable to align with @types/pg. Unfortunately TS is not great with multiple boolean conditions. The changes here were the least disruptive I could come up with

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) October 12, 2023 13:31
@AbhiPrasad AbhiPrasad merged commit e507110 into getsentry:develop Oct 12, 2023
69 checks passed
@aldenquimby aldenquimby deleted the pg-module branch October 12, 2023 17:49
@AbhiPrasad
Copy link
Member

Released with https://github.com/getsentry/sentry-javascript/releases/tag/7.74.0!

@aldenquimby
Copy link
Contributor Author

@AbhiPrasad thank you!

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.

None yet

2 participants