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

Client-side hot reloading / HMR #630

Merged
merged 25 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3ca80ca
Add the required npm modules
vmarta May 19, 2022
e561467
Set up a working hmr
vmarta May 21, 2022
f839a20
Merge branch 'develop' into hot-reloading
vmarta May 24, 2022
27c039e
Update package-lock.json
vmarta May 24, 2022
9b95213
Delete comments, todos
vmarta May 25, 2022
9d0cefc
Add a comment
vmarta May 25, 2022
87b87b1
No longer breaking the express template
vmarta May 25, 2022
be25694
Some refactoring
vmarta May 25, 2022
0988489
attempt to fix test
kevinxh May 26, 2022
429686f
Merge branch 'hot-reloading' of https://github.com/SalesforceCommerce…
kevinxh May 26, 2022
26dd4c7
revert previous change
kevinxh May 26, 2022
6c9ff0c
Only `client` now uses the hot-reload related plugins
vmarta May 26, 2022
ad8285e
Refactor to use the `extend()` method instead
vmarta May 26, 2022
22a9e33
Fix failing CI tests
vmarta May 26, 2022
ba99e9f
Loadable extractor fix for hot reloading (#632)
kevinxh May 27, 2022
8154083
Additional folder to watch and build
vmarta May 27, 2022
0d74030
Able to turn off hmr
vmarta May 27, 2022
204b05b
Remove unnecessary line
vmarta May 27, 2022
a1819a1
Add comments
vmarta May 27, 2022
53d0f6c
Also check env variable before attaching the middleware
vmarta May 27, 2022
a91da2b
Remove npm scripts
vmarta May 27, 2022
1b24eaf
More robust way to replace the babel-loader rule
vmarta May 27, 2022
5dfe903
Merge branch 'develop' into hot-reloading
vmarta May 27, 2022
3e308cc
Rename id to be clearer
vmarta May 27, 2022
7ea58fa
Update CHANGELOG.md
vmarta May 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/pwa-kit-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Replace `Mobify` references/links with proper PWA Kit values. [#619](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/619)
- Add support for a custom build directory to `pwa-kit-dev build`. [#628](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/628)
- By default, enable client-side hot module replacement [#630](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/630)

## v2.0.0 (May 16, 2022)

Expand Down
13 changes: 11 additions & 2 deletions packages/pwa-kit-dev/bin/pwa-kit-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,17 @@ const main = () => {
.addOption(
new program.Option('--inspect', 'enable debugging with --inspect on the node process')
)
.action(({inspect}) => {
execSync(`node${inspect ? ' --inspect' : ''} ${p.join(process.cwd(), 'app', 'ssr.js')}`)
.addOption(new program.Option('--noHMR', 'disable the client-side hot module replacement'))
.action(({inspect, noHMR}) => {
execSync(
`node${inspect ? ' --inspect' : ''} ${p.join(process.cwd(), 'app', 'ssr.js')}`,
{
env: {
...process.env,
...(noHMR ? {HMR: 'false'} : {})
}
}
)
})

program
Expand Down
Loading