Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/preactjs/prefresh
Hot Module Reloading for Preact
https://github.com/preactjs/prefresh
hmr hmr-enabler hmr-plugin hooks preact
Last synced: 6 days ago
JSON representation
Hot Module Reloading for Preact
- Host: GitHub
- URL: https://github.com/preactjs/prefresh
- Owner: preactjs
- License: mit
- Created: 2020-04-29T11:45:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-13T06:32:29.000Z (3 months ago)
- Last Synced: 2024-10-29T15:06:34.402Z (3 months ago)
- Topics: hmr, hmr-enabler, hmr-plugin, hooks, preact
- Language: JavaScript
- Homepage:
- Size: 3 MB
- Stars: 377
- Watchers: 5
- Forks: 48
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-list - prefresh
README
# Prefresh
Fast-refresh for Preact!
## Integrations
- [@web/dev-server](https://github.com/preactjs/prefresh/tree/main/packages/web-dev-server)
- [gatsby](https://www.gatsbyjs.org/packages/gatsby-plugin-preact/)
- [nollup](https://github.com/preactjs/prefresh/tree/main/packages/nollup)
- [vite](https://github.com/preactjs/prefresh/tree/main/packages/vite)
- [webpack](https://github.com/preactjs/prefresh/tree/main/packages/webpack)[Writing your own integration](https://dev.to/jovidecroock/prefresh-fast-refresh-for-preact-26kg)
## Best practices
### Recognition
We need to be able to recognise your components, this means that components should
start with a capital letter and hook should start with `use` followed by a capital letter.
This allows the Babel plugin to effectively recognise these.Do note that a component as seen below is not named.
```jsx
export default () => {
returnWant to refresh
;
};
```Instead do:
```jsx
const Refresh = () => {
returnWant to refresh
;
};export default Refresh;
```When you are working with HOC's be sure to lift up the `displayName` so we can
recognise it as a component.## Usage in IE11
If you want to use `@prefresh/webpack` with IE11, you'll need to transpile the `@prefresh/core` and `@prefresh/utils` packages.