Skip to content

Commit

Permalink
updated: modernize source code and migrate to esm
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Nov 10, 2023
1 parent 7752869 commit e60f748
Show file tree
Hide file tree
Showing 11 changed files with 3,131 additions and 6,471 deletions.
5 changes: 0 additions & 5 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends: 'eslint-config-riot'
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ name: test

on:
push:
branches: [ main, dev ]
branches: [main, dev]
pull_request:
branches: [ main, dev ]
branches: [main, dev]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [18.x, 19.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ yarn.lock
.idea

# generated files
hydrate.js
/index.js
/index.cjs
1 change: 1 addition & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@riotjs/prettier-config')
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const hydrateWithMyComponent = hydrate(MyComponent)
// hydrate the SSR DOM contained in the #root element
hydrateWithMyComponent(
document.getElementById('root'),
window.__INITIAL_APPLICATION_PROPS__
window.__INITIAL_APPLICATION_PROPS__,
)
```

Expand All @@ -43,7 +43,7 @@ You can use the `onBeforeHydrate` and `onHydrated` callback in your components t
},
onHydrated() {
// do something after the hydration
}
},
}
</script>
</my-component>
Expand All @@ -68,15 +68,10 @@ The `hydrate` method will mount your components on a clone of your target node n
</my-component>
```


[ci-image]:https://img.shields.io/github/actions/workflow/status/riot/hydrate/test.yml?style=flat-square
[ci-url]:https://github.com/riot/hydrate/actions

[license-image]:http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]:LICENSE

[npm-version-image]:http://img.shields.io/npm/v/@riotjs/hydrate.svg?style=flat-square
[npm-downloads-image]:http://img.shields.io/npm/dm/@riotjs/hydrate.svg?style=flat-square
[npm-url]:https://npmjs.org/package/@riotjs/hydrate


[ci-image]: https://img.shields.io/github/actions/workflow/status/riot/hydrate/test.yml?style=flat-square
[ci-url]: https://github.com/riot/hydrate/actions
[license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]: LICENSE
[npm-version-image]: http://img.shields.io/npm/v/@riotjs/hydrate.svg?style=flat-square
[npm-downloads-image]: http://img.shields.io/npm/dm/@riotjs/hydrate.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@riotjs/hydrate
Loading

0 comments on commit e60f748

Please sign in to comment.