GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(core): Return array or string from getTraceMetaTags() by s1gr1d · Pull Request #13293 · getsentry/sentry-javascript

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Aug 9, 2024

Copy link
Copy Markdown
Member

Changing the function signature for the convenience of returning a string or an array of strings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@s1gr1d
feat(core): Return array or string from getTraceMetaTags()
2e75dd8
@s1gr1d
s1gr1d requested a review from Lms24 August 9, 2024 13:36
@s1gr1d s1gr1d mentioned this pull request Aug 9, 2024
feat(nuxt): Always add tracing meta tags #13273
Merged
Lms24
Lms24 reviewed Aug 9, 2024
View reviewed changes

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Let's maybe wait a bit with this PR as #13281 makes some changes to the API

Generally I'm not sure if we should move forward with this change for now for the reasons outlined in the PR description of #13201

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Lms24
Lms24 reviewed Aug 9, 2024
View reviewed changes
Comment thread packages/core/src/utils/meta.ts
scope,
client,
asArray,
}: { span?: Span; scope?: Scope; client?: Client; asArray?: boolean } = {}): string | string[] {

@Lms24 Lms24 Aug 9, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

if we move forward with this, we can adjust the types so that TS knows that if asArray is true, it returns an array and otherwise a string

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@s1gr1d s1gr1d Aug 12, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The type checking should already check this as I created two function overloads above. But I am open for another approach (in the case this gets merged) :D

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Lms24 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@Lms24 Lms24 Aug 12, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

sorry, I missed this. This is what I had in mind :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@s1gr1d

s1gr1d commented Aug 12, 2024

Copy link
Copy Markdown
Member Author

I'll close this for now as this is a legit reason not to return an array:

I don't want to hand them an API that suggest they could pick one. Also, returning the API would make the API a tad less convenient to use and there's precedence for the simple string approach.
-- from #13201

Lms24 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@s1gr1d s1gr1d closed this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Lms24 Lms24 Lms24 left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@s1gr1d @Lms24
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.