-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Tech: improve global types #20184
Merged
ndelangen
merged 40 commits into
next
from
norbert/sb-1063-vite-in-dev-mode-with-storystorev6
Dec 20, 2022
Merged
Tech: improve global types #20184
Changes from 32 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
1925182
some fixes, need more work
ndelangen f8d5551
try to make builder-manager prefer mjs, for tree-shaking
ndelangen b6f3d29
trying to debug the vite-builder problem
ndelangen db36af9
unsupported temp api that's not supposed to be there, doesn't need types
ndelangen 18d3b8d
Merge branch 'next' into fix/storystorev6-vite
ndelangen 501dce1
strong typing for globals, fix issues resulting from strong global ty…
ndelangen 42bf76e
add "dom.iterable" and use global as window
ndelangen 3659bab
fix all the global typings
ndelangen e5b6648
fix start test
ndelangen f526092
fixing typings issues
ndelangen a94e7e8
fixing tests
ndelangen 5be6d25
fixes
ndelangen 141dec1
add new storybook scoped package to verdaccio config
ndelangen 3342776
fix references to global in template dirs
ndelangen 43aca90
fixes
ndelangen d9f736a
cleanup
ndelangen 5653ec8
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen 3eb16e7
Merge branch 'fix/storystorev6-vite' into norbert/sb-1063-vite-in-dev…
ndelangen 556e9e2
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen b041209
simplify globals
ndelangen 0761c15
fix
ndelangen c1a62a2
fix
ndelangen 1263ac8
ensure singleton via global
ndelangen a7c357a
reset the global every time, to get a new version
ndelangen b052066
Merge branch 'norbert/sb-1063-vite-in-dev-mode-with-storystorev6-clea…
ndelangen b0977b8
remove the window as global definition
ndelangen fe9b5d6
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen 91fe4d8
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen 6a578c8
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen 19f3ceb
fix
ndelangen adb0d25
Merge branch 'norbert/sb-1063-vite-in-dev-mode-with-storystorev6-clea…
ndelangen 4f3b666
cleanup
ndelangen a088aa4
use feature detection
ndelangen a033d29
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen d7fb0c3
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen 9da5823
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen 7c2ccbb
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen 88f5931
Merge branch 'next' into norbert/sb-1063-vite-in-dev-mode-with-storys…
ndelangen fc357d7
Restore code/lib/builder-webpack5/templates/virtualModuleModernEntry.…
ndelangen bb2e680
change to use @storybook/global in modern entry
ndelangen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* global window */ | ||
/* eslint-disable global-require, import/no-dynamic-require */ | ||
|
||
import React from 'react'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* global window */ | ||
/* eslint-disable global-require, import/no-dynamic-require */ | ||
|
||
import React from 'react'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
declare module 'global'; | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
declare var __STORYBOOK_STORY_STORE__: any; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
// TODO: following packages need definition files or a TS migration | ||
declare module 'global'; | ||
declare module 'uuid-browser/v4'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* eslint-disable no-underscore-dangle */ | ||
/* global window */ | ||
import { global } from '@storybook/global'; | ||
|
||
export const setCompodocJson = (compodocJson) => { | ||
// @ts-expect-error (Converted from ts-ignore) | ||
window.__STORYBOOK_COMPODOC_JSON__ = compodocJson; | ||
global.__STORYBOOK_COMPODOC_JSON__ = compodocJson; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* eslint-disable no-underscore-dangle */ | ||
/* global window */ | ||
import { global } from '@storybook/global'; | ||
|
||
export const setJSONDoc = (jsondoc) => { | ||
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc; | ||
global.__EMBER_GENERATED_DOC_JSON__ = jsondoc; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
code/addons/docs/template/stories/docspage/description.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
code/addons/docs/template/stories/docspage/extract-description.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
code/addons/docs/template/stories/stories-mdx/basic.stories.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
code/addons/docs/template/stories/stories-mdx/csf-in-mdx.stories.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
code/addons/docs/template/stories/stories-mdx/iframe.stories.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
code/addons/docs/template/stories/stories-mdx/play-functions.stories.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be something like
StoryStore<Renderer>
?In my PR to remove the
global
dependency, I took a crack at defining the types for storybook globals here: https://github.com/storybookjs/storybook/pull/19386/files#diff-c945b52732b89295a5b35f8ed082c713dd8002a29420b607bfc382672e203fe0R28Maybe you're planning to deal with these types in a separate PR, which would probably make sense since this is already a large PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it should be. considering this is in an addon, I didn't want to pull in, types from 'far away' packages. The PR is complex as is, and this seemed to me like a good candidate for a follow-up