strothj / react-docgen-typescript-loader

Webpack loader to generate docgen information from Typescript React components.
Other
360 stars 47 forks source link

Docs aren't updated on reload #43

Closed jtomaszewski closed 4 years ago

jtomaszewski commented 5 years ago

We use recent react-docgen-typescript-loader with typescript being compiled using babel-loader + @babel/preset-typescript . Docs are showing up very well (component name, description, props table) on initial build; but they aren't being updated at all on code reload. We need to restart webpack in order to see changes in docs.

EDIT: I just looked up the example app in this repo and there docs also aren't updated on reload. (That app uses ts-loader.)

  1. Is it normal? Or did something break recently?

  2. What's the cause?

  3. If it's desired to work like that, can we update README on that? (I can send a PR.) The non-typescript react-docgen plugin works on reload, thus I was a bit surprised seeing that TS version doesn't work in that case.

dontsave commented 5 years ago

I just added this plugin to a ts project with babel-loader 8, and also assumed that when I update Props types, the output would hot update in info as well. They don't. Is this expected behavior?

b6pzeusbc54tvhw5jgpyw8pwz2x6gs commented 5 years ago

the example app in this repo use babel-loader 8, but it doesn't work.

paales commented 5 years ago

Running into this issue as well @strothj Any idea?

thiagodebastos commented 4 years ago

I'm also running into this issue, for a while I thought it was something wrong with my setup. I will post back if I find a solution.

nekitk commented 4 years ago

Opened a PR which fixes hot reload.

While it is not merged you can use this fork or compile your own: https://www.npmjs.com/package/@nekitk/react-docgen-typescript-loader

strothj commented 4 years ago

Thanks @nekitk, the pull request has been merge!