Title: Export a type for Remix v2 `MetaFunction`s · Issue #9358 · getsentry/sentry-javascript · GitHub
Open Graph Title: Export a type for Remix v2 `MetaFunction`s · Issue #9358 · getsentry/sentry-javascript
X Title: Export a type for Remix v2 `MetaFunction`s · Issue #9358 · getsentry/sentry-javascript
Description: Discussed in #9340 Originally posted by tmcw October 23, 2023 I just updated to Remix v2 and the newest version of @sentry/remix. My MetaFunction looks like export const meta: MetaFunction = ({ data }) => { return [ { "sentry-trace": dat...
Open Graph Description: Discussed in #9340 Originally posted by tmcw October 23, 2023 I just updated to Remix v2 and the newest version of @sentry/remix. My MetaFunction looks like export const meta: MetaFunction = ({ dat...
X Description: Discussed in #9340 Originally posted by tmcw October 23, 2023 I just updated to Remix v2 and the newest version of @sentry/remix. My MetaFunction looks like export const meta: MetaFunction = ({ dat...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/9358
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Export a type for Remix v2 `MetaFunction`s","articleBody":"### Discussed in https://github.com/getsentry/sentry-javascript/discussions/9340\r\n\r\n\u003cdiv type='discussions-op-text'>\r\n\r\n> \u003csup>Originally posted by **tmcw** October 23, 2023\u003c/sup>\r\n> I just updated to Remix v2 and the newest version of `@sentry/remix`. My MetaFunction looks like\r\n>\r\n> ```\r\n> export const meta: MetaFunction = ({ data }) => {\r\n> return [\r\n> {\r\n> \"sentry-trace\": data.sentryTrace || \"dev\",\r\n> },\r\n> {\r\n> baggage: data.sentryBaggage || \"dev\",\r\n> }\r\n> ];\r\n>};\r\n>```\r\n>\r\n> Previously, this was fine because `MetaFunction` made data typed `any` but now that it's typed `unknown`, TypeScript won't abide by this. The Sentry machinery that inserts `sentryTrace` seems to be behind the scenes and there's no type helper that I can find that would make this type-check properly.\r\n>\r\n>Also, I see that there are [integration tests for this](https://github.com/getsentry/sentry-javascript/blob/8e603b51916426cb448a1e66e0c7156cfde719c1/packages/remix/test/integration/app_v2/root.tsx#L19) but it doesn't seem like the documentation mentions using MetaFunction anymore?\r\n>\r\n> I don't want to type `data` as `any` because it would make any other data access in my meta function unsafe. Is there a good way to solve this problem?\r\n\u003c/div>\r\n\r\n\r\nWe should export a type to be used in place of MetaFunction for Remix v2.\r\n","author":{"url":"https://github.com/onurtemizkan","@type":"Person","name":"onurtemizkan"},"datePublished":"2023-10-25T01:59:40Z","url":"https://github.com/getsentry/sentry-javascript/issues/9358"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a48a205f-2a9c-04d7-6a5d-f68245542319 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB28:1FCE:6CDC19:994D58:6B0449D4 |
| html-safe-nonce | 7e3dae34e315ea474eabceafa677c387b5851a1025edb8090294b5e89c5ec147 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjI4OjFGQ0U6NkNEQzE5Ojk5NEQ1ODo2QjA0NDlENCIsInZpc2l0b3JfaWQiOiI2NjU5MzIyNDg0NzI4NTQ3Nzk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | eadc665f4f48fb47dfab60e0c559b12ae87b3c835ea9d4af7f8f0e92977502a2 |
| hovercard-subject-tag | issue:1960367473 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/9358/issue_layout |
| twitter:image | https://opengraph.githubassets.com/701786bebadc1b796f35ede0943e0552479714c24be8523e0140c32b91d66e78/getsentry/sentry-javascript/issues/9358 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/701786bebadc1b796f35ede0943e0552479714c24be8523e0140c32b91d66e78/getsentry/sentry-javascript/issues/9358 |
| og:image:alt | Discussed in #9340 Originally posted by tmcw October 23, 2023 I just updated to Remix v2 and the newest version of @sentry/remix. My MetaFunction looks like export const meta: MetaFunction = ({ dat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | onurtemizkan |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width