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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing examples for HMR #902

Closed
datenreisender opened this issue Feb 8, 2019 · 6 comments · Fixed by #961
Closed

Missing examples for HMR #902

datenreisender opened this issue Feb 8, 2019 · 6 comments · Fixed by #961
Labels

Comments

@datenreisender
Copy link
Contributor

In https://github.com/TypeStrong/ts-loader#hot-module-replacement two example project setups for HMR are referenced, which were deleted in #899. Please describe more thoroughly in README.md what was once in the examples. I am at the moment struggling with setting up HMR and as a guidance tried to look at the examples before they were removed but also failed to make them work. :-/

@johnnyreilly
Copy link
Member

I recommend looking at an older version of the repo if you want to see the examples. It was removed as the HMR example had some problems. As I understand it hmr has never really worked reliably enough for me to be comfortable having an example in the repo. If that changes I'd be happy to readdress. We should really remove reference to old examples from the repo

@datenreisender
Copy link
Contributor Author

If for you, as you wrote, "hmr has never really worked reliably enough" then I suggest adding an according warning to the section of the README, besides removing the reference to the old examples. My suggestion for that section:

### Hot Module replacement

We do not support HMR as we did not yet work out a reliable way how to set it up. 

If you want to give `webpack-dev-server` HMR a try, follow the official [webpack HMR guide](https://webpack.js.org/guides/hot-module-replacement/), then tweak a few config options for `ts-loader`:

1. Set `transpileOnly` to `true` (see [transpileOnly](#transpileonly-boolean-defaultfalse) for config details and recommendations above).
2. Inside your HMR acceptance callback function, maybe re-require the module that was replaced.

@stale
Copy link

stale bot commented Apr 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 19, 2019
@stale
Copy link

stale bot commented Apr 26, 2019

Closing as stale. Please reopen if you'd like to work on this further.

@stale stale bot closed this as completed Apr 26, 2019
@brainkim
Copy link

brainkim commented Jul 7, 2019

Might want to update this part of the README https://github.com/TypeStrong/ts-loader/#hot-module-replacement rather than pointing to dead example links.

@johnnyreilly
Copy link
Member

Would you like to submit a PR?

datenreisender added a commit to datenreisender/ts-loader that referenced this issue Jul 8, 2019
This fixes TypeStrong#902. It removes the dead example links and changes the wording to express that hot module replacement is not really supported by ts-loader.
johnnyreilly pushed a commit that referenced this issue Jul 8, 2019
This fixes #902. It removes the dead example links and changes the wording to express that hot module replacement is not really supported by ts-loader.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants