Skip to content

Comments

feat(v8/serverless): Use subpath exports package#10561

Closed
AbhiPrasad wants to merge 6 commits intodevelopfrom
abhi-serverless-exports
Closed

feat(v8/serverless): Use subpath exports package#10561
AbhiPrasad wants to merge 6 commits intodevelopfrom
abhi-serverless-exports

Conversation

@AbhiPrasad
Copy link
Contributor

This is a direct follow up to #10540, where I refactored the serverless package to use subpath exports.

// before
import * as Sentry from '@sentry/serverless';

Sentry.AWSLambda.init(...);

// after
import * as Sentry from '@sentry/serverless/aws';

Sentry.init(...);

// before
import * as Sentry from '@sentry/serverless';

Sentry.GCPFunction.init(...);

// after
import * as Sentry from '@sentry/serverless/gcp';

Sentry.init(...);

Does this API feel reasonable to you? Should we go a step further and just publish separate packages?

@AbhiPrasad AbhiPrasad requested review from lforst and mydea February 7, 2024 21:32
".": {
"import": {
"default": "./build/npm/esm/index.js",
"types": "./build/npm/types/index.d.ts"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the future this will be *.mjs fwiw

package: '@sentry/serverless',
package: '@sentry/serverless/aws',
exports: Object.keys(SentryServerless),
ignoreExports: ['cron', 'hapiErrorPlugin', 'enableAnrDetection'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add another e2e test to validate the subpath exports if we are fine with this approach.

@AbhiPrasad AbhiPrasad self-assigned this Feb 7, 2024
@mydea
Copy link
Member

mydea commented Feb 8, 2024

I don't have a strong opinion, but I think I tend to say let's maybe just make these dedicated packages. As logically otherwise e.g. react/vue/svelte could also just be subpath exports from browser 🤔 But maybe serverless is also simply "less important" and it's good enough this way - not sure.

@lforst
Copy link
Contributor

lforst commented Feb 8, 2024

I am with Francesco on this one. No hard opinions but dedicated packages would make a bit more sense to me.

@AbhiPrasad AbhiPrasad closed this Feb 9, 2024
@AbhiPrasad AbhiPrasad deleted the abhi-serverless-exports branch February 9, 2024 22:31
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.

3 participants