Skip to content

Commit

Permalink
Merge pull request #21421 from storybookjs/tom/21340-remove-old-modul…
Browse files Browse the repository at this point in the history
…e-hot-decline

Core: Remove pointless `module.hot.decline()` in addons
  • Loading branch information
ndelangen authored Mar 6, 2023
2 parents 29a33ed + 889c3f1 commit fdec40c
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 62 deletions.
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();
}

0 comments on commit fdec40c

Please sign in to comment.