strothj/react-docgen-typescript-loader

Docs aren't updated on reload

Closed this issue · 6 comments

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.

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?

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

Running into this issue as well @strothj Any idea?

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.

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

Thanks @nekitk, the pull request has been merge!