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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade TypeScript, Storybook and Prettier #1140

Merged
merged 1 commit into from
Jun 16, 2022
Merged

Upgrade TypeScript, Storybook and Prettier #1140

merged 1 commit into from
Jun 16, 2022

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Jun 16, 2022

TypeScript 4.6

TypeScript 4.7

  • Go to Source Definition - finally!! This command takes you to the actual source code of a method, object or whatever, instead of to its type declaration! You can access the command after upgrading VSCode, by right-clicking on something in the editor or via the command palette. Ctrl+click still takes you to the type declaration.
  • Instantiation Expressions - this is a really cool feature that we may be able to benefit from in the future:
interface Box<T> {
    value: T;
}

function makeBox<T>(value: T): Box<T> {
    return { value };
}

// BEFORE
function makeHammerBox(hammer: Hammer) {
    return makeBox(hammer);
}
// or...
const makeWrenchBox: (wrench: Wrench) => Box<Wrench> = makeBox;

// AFTER
const makeHammerBox = makeBox<Hammer>;
const makeWrenchBox = makeBox<Wrench>;

// Also works for Array, Map, Set:
const ErrorMap = Map<string, Error>;
const errorMap = new ErrorMap(); // instead of `new Map<string, Error>()`

Storybook 6.5

  • Brings support for React 18, so it will make upgrading easier.
  • At last, the UI has buttons to open/close the controls panel 馃帀
  • The bug that navigated back to the first page when changing the value of a control seems to be fixed 馃帀
  • I've enabled the new webpack 5 builder with caching and lazy compilation, which speeds up starting the Storybook significantly 馃帀
  • There's also an experimental Vite builder, but apparently it's not faster than webpack 5 with lazy compilation.
  • I tried enabling experimental support for MDX v2, but it broke our markdown tables and I wasn't sure how to bring them back, so I gave up.
  • The auto-generated titles of the stories now have spaces:
    image

Prettier 2.7

  • Brings a new --cache CLI option that speeds things up condierably 馃帀

@axelboc axelboc changed the title Upgrade TypeScript and Storybook Upgrade TypeScript, Storybook and Prettier Jun 16, 2022
@axelboc axelboc merged commit 39f1a26 into main Jun 16, 2022
@axelboc axelboc deleted the storybook-6.5 branch June 16, 2022 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants