Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Remove pointless module.hot.decline() in addons #21421

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions code/addons/a11y/src/a11yRunner.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
/// <reference types="webpack-env" />

import { global } from '@storybook/global';
import { addons } from '@storybook/preview-api';
import { EVENTS } from './constants';
import type { A11yParameters } from './params';

const { document, window: globalWindow } = global;

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}

const channel = addons.getChannel();
// Holds axe core running state
let active = false;
Expand Down
6 changes: 0 additions & 6 deletions code/addons/a11y/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
/// <reference types="webpack-env" />

export { PARAM_KEY } from './constants';
export * from './params';

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}
6 changes: 0 additions & 6 deletions code/addons/actions/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/// <reference types="webpack-env" />

export * from './constants';
export * from './models';
export * from './runtime';

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}
6 changes: 0 additions & 6 deletions code/addons/backgrounds/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
/// <reference types="webpack-env" />

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}

// make it work with --isolatedModules
export default {};
4 changes: 0 additions & 4 deletions code/addons/highlight/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export { HIGHLIGHT, RESET_HIGHLIGHT } from './constants';

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}

// make it work with --isolatedModules
export default {};
4 changes: 0 additions & 4 deletions code/addons/highlight/src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ export const highlightObject = (color: string) => ({
boxShadow: '0 0 0 6px rgba(255,255,255,0.6)',
});

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}

interface HighlightInfo {
/** html selector of the element */
elements: string[];
Expand Down
6 changes: 0 additions & 6 deletions code/addons/jest/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference types="webpack-env" />

import { addons } from '@storybook/preview-api';
import { normalize, sep } from 'upath';
import { ADD_TESTS, defineJestParameter } from './shared';
Expand Down Expand Up @@ -62,7 +60,3 @@ export const withTests = (userOptions: { results: any; filesExt?: string }) => {
return storyFn();
};
};

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}
6 changes: 0 additions & 6 deletions code/addons/links/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference types="webpack-env" />

import { dedent } from 'ts-dedent';

let hasWarned = false;
Expand All @@ -20,7 +18,3 @@ export function LinkTo(): null {
}

export { linkTo, hrefTo, withLinks, navigate } from './utils';

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}
6 changes: 0 additions & 6 deletions code/addons/measure/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
/// <reference types="webpack-env" />

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}

// make it work with --isolatedModules
export default {};
6 changes: 0 additions & 6 deletions code/addons/outline/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
/// <reference types="webpack-env" />

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}

// make it work with --isolatedModules
export default {};
6 changes: 0 additions & 6 deletions code/addons/storysource/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/// <reference types="webpack-env" />

import { ADDON_ID, PANEL_ID } from './events';

export { ADDON_ID, PANEL_ID };

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}