diff --git a/.craft.yml b/.craft.yml index 4f52ed1ea6ba..a5df75a24519 100644 --- a/.craft.yml +++ b/.craft.yml @@ -111,6 +111,9 @@ targets: - name: npm id: '@sentry/tanstackstart' includeNames: /^sentry-tanstackstart-\d.*\.tgz$/ + - name: npm + id: '@sentry/tanstackstart-react' + includeNames: /^sentry-tanstackstart-react-\d.*\.tgz$/ - name: npm id: '@sentry/gatsby' includeNames: /^sentry-gatsby-\d.*\.tgz$/ diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index a68dea235925..7446ed57aabc 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -50,6 +50,7 @@ body: - '@sentry/solidstart' - '@sentry/svelte' - '@sentry/sveltekit' + - '@sentry/tanstackstart-react' - '@sentry/vue' - '@sentry/wasm' - Sentry Browser Loader diff --git a/README.md b/README.md index 50f1b7125a94..8b22dafb0c63 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ package. Please refer to the README and instructions of those SDKs for more deta - [`@sentry/nestjs`](https://github.com/getsentry/sentry-javascript/tree/master/packages/nestjs): SDK for NestJS - [`@sentry/nextjs`](https://github.com/getsentry/sentry-javascript/tree/master/packages/nextjs): SDK for Next.js - [`@sentry/remix`](https://github.com/getsentry/sentry-javascript/tree/master/packages/remix): SDK for Remix +- [`@sentry/tanstackstart-react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/tanstackstart-react): SDK for TanStack Start React - [`@sentry/aws-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/aws-serverless): SDK for AWS Lambda Functions - [`@sentry/google-cloud-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud-serverless): diff --git a/dev-packages/e2e-tests/verdaccio-config/config.yaml b/dev-packages/e2e-tests/verdaccio-config/config.yaml index af7d62521c59..8535c5898175 100644 --- a/dev-packages/e2e-tests/verdaccio-config/config.yaml +++ b/dev-packages/e2e-tests/verdaccio-config/config.yaml @@ -176,6 +176,12 @@ packages: unpublish: $all # proxy: npmjs # Don't proxy for E2E tests! + '@sentry/tanstackstart-react': + access: $all + publish: $all + unpublish: $all + # proxy: npmjs # Don't proxy for E2E tests! + '@sentry/types': access: $all publish: $all diff --git a/docs/new-sdk-release-checklist.md b/docs/new-sdk-release-checklist.md index 7f1811e53d8f..3bf931a1dab4 100644 --- a/docs/new-sdk-release-checklist.md +++ b/docs/new-sdk-release-checklist.md @@ -62,6 +62,12 @@ differ slightly for other SDKs depending on how they are structured and how they - [ ] If the package you're adding is a dependency of fullstack framework (e.g. Remix or NextJS) SDKs, make sure that your package is added to the integration test apps' `"resolutions"` field in their `package.json`s. +- [ ] Add the new package to the "root" README inside the repository. + +- [ ] Add the new package to the GitHub Issue bug template. + +- [ ] Create label inside the GitHub repo named "Package: foobar". + ## Cutting the Release When you’re ready to make the first release, there are a couple of steps that need to be performed in the **correct diff --git a/package.json b/package.json index 460d2c42abb1..443b45361873 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "packages/svelte", "packages/sveltekit", "packages/tanstackstart", + "packages/tanstackstart-react", "packages/types", "packages/typescript", "packages/vercel-edge", diff --git a/packages/tanstackstart-react/.eslintrc.js b/packages/tanstackstart-react/.eslintrc.js new file mode 100644 index 000000000000..54e8382b22a8 --- /dev/null +++ b/packages/tanstackstart-react/.eslintrc.js @@ -0,0 +1,10 @@ +module.exports = { + env: { + browser: true, + node: true, + }, + parserOptions: { + jsx: true, + }, + extends: ['../../.eslintrc.js'], +}; diff --git a/packages/tanstackstart-react/LICENSE b/packages/tanstackstart-react/LICENSE new file mode 100644 index 000000000000..0da96cd2f885 --- /dev/null +++ b/packages/tanstackstart-react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Functional Software, Inc. dba Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/tanstackstart-react/README.md b/packages/tanstackstart-react/README.md new file mode 100644 index 000000000000..6d28df3ba6df --- /dev/null +++ b/packages/tanstackstart-react/README.md @@ -0,0 +1,52 @@ +
+
+
+
+
>( + WrappedComponent: React.ComponentType
, +): React.FC
{ + return WrappedComponent as React.FC
; +} + +/** + * Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense. + */ +export function showReportDialog(): void { + return; +} diff --git a/packages/tanstackstart-react/test/temp.test.ts b/packages/tanstackstart-react/test/temp.test.ts new file mode 100644 index 000000000000..28874b0d1c84 --- /dev/null +++ b/packages/tanstackstart-react/test/temp.test.ts @@ -0,0 +1,7 @@ +import { describe, it, expect } from 'vitest'; + +describe('Basic test suite', () => { + it('should pass', () => { + expect(true).toBe(true); + }); +}); diff --git a/packages/tanstackstart-react/test/tsconfig.json b/packages/tanstackstart-react/test/tsconfig.json new file mode 100644 index 000000000000..38ca0b13bcdd --- /dev/null +++ b/packages/tanstackstart-react/test/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.test.json" +} diff --git a/packages/tanstackstart-react/tsconfig.json b/packages/tanstackstart-react/tsconfig.json new file mode 100644 index 000000000000..20cf507e5203 --- /dev/null +++ b/packages/tanstackstart-react/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*"], + "compilerOptions": { + "lib": ["es2018", "es2020.string"], + "module": "Node16" + } +} diff --git a/packages/tanstackstart-react/tsconfig.test.json b/packages/tanstackstart-react/tsconfig.test.json new file mode 100644 index 000000000000..bbbebba51d18 --- /dev/null +++ b/packages/tanstackstart-react/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "include": ["test/**/*", "vite.config.ts"], + "compilerOptions": { + "types": ["node"], + "lib": ["DOM", "ESNext"] + } +} diff --git a/packages/tanstackstart-react/tsconfig.types.json b/packages/tanstackstart-react/tsconfig.types.json new file mode 100644 index 000000000000..b1a51db073c2 --- /dev/null +++ b/packages/tanstackstart-react/tsconfig.types.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "build/types" + } +} diff --git a/packages/tanstackstart-react/vite.config.ts b/packages/tanstackstart-react/vite.config.ts new file mode 100644 index 000000000000..f18ec92095bc --- /dev/null +++ b/packages/tanstackstart-react/vite.config.ts @@ -0,0 +1,8 @@ +import baseConfig from '../../vite/vite.config'; + +export default { + ...baseConfig, + test: { + ...baseConfig.test, + }, +}; diff --git a/packages/tanstackstart/README.md b/packages/tanstackstart/README.md index 35e369cf25e9..e5ef2c111dd6 100644 --- a/packages/tanstackstart/README.md +++ b/packages/tanstackstart/README.md @@ -4,49 +4,19 @@
-# Official Sentry SDK for TanStack Start (Alpha) +# Utilities for the Sentry TanStack Start SDKs [](https://www.npmjs.com/package/@sentry/tanstackstart) [](https://www.npmjs.com/package/@sentry/tanstackstart) [](https://www.npmjs.com/package/@sentry/tanstackstart) -> NOTICE: This package is in alpha state and may be subject to breaking changes. +> NOTICE: This package is a package that contains SDK internals and does not follow semantic versioning. Use with caution. -## Getting Started - -This SDK does not have docs yet. Stay tuned. - -## Compatibility - -The minimum supported version of TanStack Start is `1.111.12`. - -## Custom Usage - -To set context information or to send manual events, you can use `@sentry/tanstackstart` as follows: - -```ts -import * as Sentry from '@sentry/tanstackstart'; - -// Set user information, as well as tags and further extras -Sentry.setTag('user_mode', 'admin'); -Sentry.setUser({ id: '4711' }); -Sentry.setContext('application_area', { location: 'checkout' }); - -// Add a breadcrumb for future events -Sentry.addBreadcrumb({ - message: '"Add to cart" clicked', - // ... -}); - -// Capture exceptions or messages -Sentry.captureException(new Error('Oh no.')); -Sentry.captureMessage('Hello, world!'); -``` +This package contains shared utilities for Sentry TanStack Start SDKs. +If you are looking for the actual TanStack Start React SDK package, see: https://www.npmjs.com/package/@sentry/tanstackstart-react ## Links - - - [Sentry.io](https://sentry.io/?utm_source=github&utm_medium=npm_tanstackstart) - [Sentry Discord Server](https://discord.gg/Ww9hbqr) - [Stack Overflow](https://stackoverflow.com/questions/tagged/sentry) diff --git a/packages/tanstackstart/package.json b/packages/tanstackstart/package.json index 992a07d9c6eb..766a85278741 100644 --- a/packages/tanstackstart/package.json +++ b/packages/tanstackstart/package.json @@ -1,7 +1,7 @@ { "name": "@sentry/tanstackstart", "version": "9.5.0", - "description": "Official Sentry SDK for TanStack Start", + "description": "Utilities for the Sentry TanStack Start SDKs", "repository": "git://github.com/getsentry/sentry-javascript.git", "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/tanstackstart", "author": "Sentry", @@ -27,16 +27,6 @@ "import": "./build/esm/index.server.js", "require": "./build/cjs/index.server.js" } - }, - "./import": { - "import": { - "default": "./build/import-hook.mjs" - } - }, - "./loader": { - "import": { - "default": "./build/loader-hook.mjs" - } } }, "typesVersions": { @@ -49,15 +39,7 @@ "publishConfig": { "access": "public" }, - "dependencies": { - "@opentelemetry/api": "^1.9.0", - "@opentelemetry/semantic-conventions": "^1.30.0", - "@sentry-internal/browser-utils": "9.5.0", - "@sentry/core": "9.5.0", - "@sentry/node": "9.5.0", - "@sentry/opentelemetry": "9.5.0", - "@sentry/react": "9.5.0" - }, + "dependencies": {}, "scripts": { "build": "run-p build:transpile build:types", "build:dev": "yarn build", diff --git a/packages/tanstackstart/rollup.npm.config.mjs b/packages/tanstackstart/rollup.npm.config.mjs index 9b334bdbae41..25850a8309c6 100644 --- a/packages/tanstackstart/rollup.npm.config.mjs +++ b/packages/tanstackstart/rollup.npm.config.mjs @@ -1,4 +1,4 @@ -import { makeBaseNPMConfig, makeNPMConfigVariants, makeOtelLoaders } from '@sentry-internal/rollup-utils'; +import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils'; export default [ ...makeNPMConfigVariants( @@ -12,5 +12,4 @@ export default [ ], }), ), - ...makeOtelLoaders('./build', 'sentry-node'), ]; diff --git a/packages/tanstackstart/src/client/index.ts b/packages/tanstackstart/src/client/index.ts index c45aad673ad0..cb0ff5c3b541 100644 --- a/packages/tanstackstart/src/client/index.ts +++ b/packages/tanstackstart/src/client/index.ts @@ -1 +1 @@ -export * from '@sentry/react'; +export {}; diff --git a/packages/tanstackstart/src/common/index.ts b/packages/tanstackstart/src/common/index.ts index d83c684d1523..cb0ff5c3b541 100644 --- a/packages/tanstackstart/src/common/index.ts +++ b/packages/tanstackstart/src/common/index.ts @@ -1,23 +1 @@ -/** - * A middleware handler that can be passed to TanStack Start's `createMiddleware().server(...)` method as [global middleware](https://tanstack.com/start/latest/docs/framework/react/middleware#global-middleware) for instrumenting server functions. - */ -export function sentryGlobalServerMiddlewareHandler() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function>( - WrappedComponent: React.ComponentType
, -): React.FC
{ - return WrappedComponent as React.FC
; -} - -/** - * Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense. - */ -export function showReportDialog(): void { - return; -} +export {}; diff --git a/yarn.lock b/yarn.lock index 758c24916a6d..33da7621e609 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10884,7 +10884,16 @@ aws-ssl-profiles@^1.1.1: resolved "https://registry.yarnpkg.com/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz#157dd77e9f19b1d123678e93f120e6f193022641" integrity sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g== -axios@1.7.7, axios@^1.0.0, axios@^1.7.7: +axios@1.8.2: + version "1.8.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.8.2.tgz#fabe06e241dfe83071d4edfbcaa7b1c3a40f7979" + integrity sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + +axios@^1.0.0, axios@^1.7.7: version "1.7.7" resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.7.tgz#2f554296f9892a72ac8d8e4c5b79c14a91d0a47f" integrity sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q== @@ -28630,7 +28639,6 @@ stylus@0.59.0, stylus@^0.59.0: sucrase@^3.27.0, sucrase@^3.35.0, sucrase@getsentry/sucrase#es2020-polyfills: version "3.36.0" - uid fd682f6129e507c00bb4e6319cc5d6b767e36061 resolved "https://codeload.github.com/getsentry/sucrase/tar.gz/fd682f6129e507c00bb4e6319cc5d6b767e36061" dependencies: "@jridgewell/gen-mapping" "^0.3.2"