Skip to content

Conversation

@chargome
Copy link
Member

@chargome chargome commented Nov 4, 2024

closes #9013

The new placeholder ___JS_PACKAGE___ can be used within code blocks and automatically injects the corresponding node package (e.g. resolves to @sentry/react). So code snippets in platform includes that basically contain the same code apart from the import statement can now be replaced with a single code snippet.

The pr also includes an example where this feature is used for replay canvas.

@chargome chargome self-assigned this Nov 4, 2024
@vercel
Copy link

vercel bot commented Nov 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
changelog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 4, 2024 3:13pm
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 4, 2024 3:13pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
develop-docs ⬜️ Ignored (Inspect) Nov 4, 2024 3:13pm

@codecov
Copy link

codecov bot commented Nov 4, 2024

Bundle Report

Changes will decrease total bundle size by 2.26kB (-0.01%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 8.57MB 2.48kB (-0.03%) ⬇️
sentry-docs-client-array-push 8.94MB 224 bytes (0.0%) ⬆️

Copy link
Collaborator

@a-hariti a-hariti left a comment

Choose a reason for hiding this comment

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

Awesome 🎉

@@ -1,17 +0,0 @@
```javascript {13} {filename:sentry.client.config.js}
Copy link
Member

Choose a reason for hiding this comment

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

m: These filenames are important, I don't think we can just remove these and have the blocks generic :(

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, maybe we can add a frontmatter bit with the filename somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, I missed that. That's actually bad since this will force us again to create separate files.

@a-hariti adding config file names would get messy since some frameworks have up to three different config files depending on the runtime

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if the need for this feature is actually worth the time, maybe we'll just close it and not overcomplicate this here – wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree

Copy link
Member

Choose a reason for hiding this comment

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

Agreed on closing

@chargome chargome closed this Nov 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to auto-detect JS package for imports

4 participants