Skip to content

Commit c106fd6

Browse files
committed
rename feedback2 to feedback
1 parent d8b6242 commit c106fd6

File tree

91 files changed

+170
-3944
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+170
-3944
lines changed

.size-limit.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,23 @@ module.exports = [
5555
limit: '35 KB',
5656
},
5757
{
58-
name: '@sentry/browser (incl. Feedback) - Webpack (gzipped)',
58+
name: '@sentry/browser (incl. feedbackIntegration) - Webpack (gzipped)',
5959
path: 'packages/browser/build/npm/esm/index.js',
6060
import: '{ init, feedbackIntegration }',
6161
gzip: true,
6262
limit: '50 KB',
6363
},
6464
{
65-
name: '@sentry/browser (incl. feedback2Integration) - Webpack (gzipped)',
65+
name: '@sentry/browser (incl. feedbackModalIntegration) - Webpack (gzipped)',
6666
path: 'packages/browser/build/npm/esm/index.js',
67-
import: '{ init, feedback2Integration }',
67+
import: '{ init, feedbackIntegration, feedbackModalIntegration }',
6868
gzip: true,
6969
limit: '50 KB',
7070
},
7171
{
72-
name: '@sentry/browser (incl. feedback2ModalIntegration) - Webpack (gzipped)',
72+
name: '@sentry/browser (incl. feedbackScreenshotIntegration) - Webpack (gzipped)',
7373
path: 'packages/browser/build/npm/esm/index.js',
74-
import: '{ init, feedback2Integration, feedback2ModalIntegration }',
75-
gzip: true,
76-
limit: '50 KB',
77-
},
78-
{
79-
name: '@sentry/browser (incl. feedback2ScreenshotIntegration) - Webpack (gzipped)',
80-
path: 'packages/browser/build/npm/esm/index.js',
81-
import: '{ init, feedback2Integration, feedback2ModalIntegration, feedback2ScreenshotIntegration }',
74+
import: '{ init, feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration }',
8275
gzip: true,
8376
limit: '50 KB',
8477
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"packages/eslint-config-sdk",
5656
"packages/eslint-plugin-sdk",
5757
"packages/feedback",
58-
"packages/feedback2",
5958
"packages/gatsby",
6059
"packages/google-cloud",
6160
"packages/integration-shims",

packages/feedback/.eslintrc.js

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,18 @@ module.exports = {
77
extends: ['../../.eslintrc.js'],
88
overrides: [
99
{
10-
files: ['jest.setup.ts', 'jest.config.ts'],
11-
parserOptions: {
12-
project: ['tsconfig.test.json'],
13-
},
10+
files: ['src/**/*.ts', 'src/**/*.tsx'],
1411
rules: {
15-
'no-console': 'off',
12+
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
1613
},
1714
},
1815
{
19-
files: ['test/**/*.ts'],
20-
21-
rules: {
22-
// most of these errors come from `new Promise(process.nextTick)`
23-
'@typescript-eslint/unbound-method': 'off',
24-
// TODO: decide if we want to enable this again after the migration
25-
// We can take the freedom to be a bit more lenient with tests
26-
'@typescript-eslint/no-floating-promises': 'off',
16+
files: ['jest.setup.ts', 'jest.config.ts'],
17+
parserOptions: {
18+
project: ['tsconfig.test.json'],
2719
},
28-
},
29-
{
30-
files: ['src/types/deprecated.ts'],
3120
rules: {
32-
'@typescript-eslint/naming-convention': 'off',
21+
'no-console': 'off',
3322
},
3423
},
3524
],

packages/feedback/package.json

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,35 @@
1818
"main": "build/npm/cjs/index.js",
1919
"module": "build/npm/esm/index.js",
2020
"types": "build/npm/types/index.d.ts",
21-
"exports": {
22-
"./package.json": "./package.json",
23-
".": {
24-
"import": {
25-
"types": "./build/npm/types/index.d.ts",
26-
"default": "./build/npm/esm/index.js"
27-
},
28-
"require": {
29-
"types": "./build/npm/types/index.d.ts",
30-
"default": "./build/npm/cjs/index.js"
31-
}
32-
}
33-
},
3421
"typesVersions": {
3522
"<4.9": {
3623
"build/npm/types/index.d.ts": [
3724
"build/npm/types-ts3.8/index.d.ts"
3825
]
3926
}
4027
},
28+
"exports": {
29+
"./package.json": "./package.json",
30+
".": {
31+
"import": {
32+
"types": "./build/npm/types/index.d.ts",
33+
"default": "./build/npm/esm/index.js"
34+
},
35+
"require": {
36+
"types": "./build/npm/types/index.d.ts",
37+
"default": "./build/npm/cjs/index.js"
38+
}
39+
}
40+
},
4141
"publishConfig": {
4242
"access": "public"
4343
},
4444
"dependencies": {
4545
"@sentry/core": "8.0.0-alpha.2",
4646
"@sentry/types": "8.0.0-alpha.2",
47-
"@sentry/utils": "8.0.0-alpha.2"
47+
"@sentry/utils": "8.0.0-alpha.2",
48+
"preact": "^10.19.4",
49+
"preact-compat": "^3.19.0"
4850
},
4951
"scripts": {
5052
"build": "run-p build:transpile build:types build:bundle",
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { makeBaseBundleConfig, makeBundleConfigVariants } from '@sentry-internal/rollup-utils';
22

3-
const baseBundleConfig = makeBaseBundleConfig({
4-
bundleType: 'addon',
5-
entrypoints: ['src/index.ts'],
6-
licenseTitle: '@sentry-internal/feedback',
7-
outputFileBase: () => 'bundles/feedback',
8-
});
9-
10-
const builds = makeBundleConfigVariants(baseBundleConfig);
11-
12-
export default builds;
3+
export default makeBundleConfigVariants(
4+
makeBaseBundleConfig({
5+
bundleType: 'addon',
6+
entrypoints: ['src/index.ts'],
7+
jsVersion: 'es6',
8+
licenseTitle: '@sentry-internal/feedback',
9+
outputFileBase: () => 'bundles/feedback',
10+
sucrase: {
11+
jsxPragma: 'h',
12+
jsxFragmentPragma: 'Fragment',
13+
},
14+
}),
15+
);

packages/feedback/rollup.npm.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ export default makeNPMConfigVariants(
1212
preserveModules: false,
1313
},
1414
},
15+
sucrase: {
16+
jsxPragma: 'h',
17+
jsxFragmentPragma: 'Fragment',
18+
},
1519
}),
1620
);

packages/feedback/src/constants.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

packages/feedback2/src/core/integration.ts renamed to packages/feedback/src/core/integration.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {
1616
SUBMIT_BUTTON_LABEL,
1717
SUCCESS_MESSAGE_TEXT,
1818
} from '../constants';
19-
import type { IFeedback2ModalIntegration } from '../modal/integration';
20-
import type { IFeedback2ScreenshotIntegration } from '../screenshot/integration';
19+
import type { IFeedbackModalIntegration } from '../modal/integration';
20+
import type { IFeedbackScreenshotIntegration } from '../screenshot/integration';
2121
import type {
2222
Dialog,
2323
FeedbackInternalOptions,
@@ -33,7 +33,7 @@ import { sendFeedback } from './sendFeedback';
3333

3434
type Unsubscribe = () => void;
3535

36-
interface PublicFeedback2Integration {
36+
interface PublicFeedbackIntegration {
3737
attachTo: (el: Element | string, optionOverrides: OverrideFeedbackConfiguration) => () => void;
3838
createWidget: (optionOverrides: OverrideFeedbackConfiguration & { shouldCreateActor?: boolean }) => Promise<Dialog>;
3939
getWidget: () => Dialog | null;
@@ -42,9 +42,9 @@ interface PublicFeedback2Integration {
4242
closeDialog: () => void;
4343
removeWidget: () => void;
4444
}
45-
export type IFeedback2Integration = IntegrationFnResult & PublicFeedback2Integration;
45+
export type IFeedbackIntegration = IntegrationFnResult & PublicFeedbackIntegration;
4646

47-
export const _feedback2Integration = (({
47+
export const _feedbackIntegration = (({
4848
// FeedbackGeneralConfiguration
4949
id = 'sentry-feedback',
5050
showBranding = true,
@@ -147,8 +147,8 @@ export const _feedback2Integration = (({
147147
if (!client) {
148148
throw new Error('Sentry Client is not initialized correctly');
149149
}
150-
const modalIntegration = client.getIntegrationByName<IFeedback2ModalIntegration>('Feedback2Modal');
151-
const screenshotIntegration = client.getIntegrationByName<IFeedback2ScreenshotIntegration>('Feedback2Screenshot');
150+
const modalIntegration = client.getIntegrationByName<IFeedbackModalIntegration>('FeedbackModal');
151+
const screenshotIntegration = client.getIntegrationByName<IFeedbackScreenshotIntegration>('FeedbackScreenshot');
152152
const screenshotIsSupported = isScreenshotSupported();
153153

154154
// START TEMP: Error messages
@@ -239,7 +239,7 @@ export const _feedback2Integration = (({
239239
};
240240

241241
return {
242-
name: 'Feedback2',
242+
name: 'Feedback',
243243
setupOnce() {
244244
if (!isBrowser() || !_options.autoInject) {
245245
return;
@@ -277,4 +277,4 @@ export const _feedback2Integration = (({
277277
};
278278
}) satisfies IntegrationFn;
279279

280-
export const feedback2Integration = defineIntegration(_feedback2Integration);
280+
export const feedbackIntegration = defineIntegration(_feedbackIntegration);

packages/feedback/src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
export { sendFeedback } from './sendFeedback';
2-
export { feedbackIntegration } from './integration';
1+
export { sendFeedback } from './core/sendFeedback';
2+
export { feedbackIntegration } from './core/integration';
3+
export { feedbackModalIntegration } from './modal/integration';
4+
export { feedbackScreenshotIntegration } from './screenshot/integration';
5+
6+
export type { OptionalFeedbackConfiguration } from './types';
7+
export type { IFeedbackIntegration } from './core/integration';

0 commit comments

Comments
 (0)