@jsenv/core 28.3.3 → 28.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js
CHANGED
|
@@ -16998,28 +16998,36 @@ const jsenvPluginAutoreloadServer = ({
|
|
|
16998
16998
|
url,
|
|
16999
16999
|
event
|
|
17000
17000
|
}) => {
|
|
17001
|
-
const
|
|
17001
|
+
const onUrlInfo = urlInfo => {
|
|
17002
|
+
const relativeUrl = formatUrlForClient(url);
|
|
17003
|
+
const hotUpdate = propagateUpdate(urlInfo);
|
|
17002
17004
|
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
|
|
17005
|
+
if (hotUpdate.declined) {
|
|
17006
|
+
notifyDeclined({
|
|
17007
|
+
cause: `${relativeUrl} ${event}`,
|
|
17008
|
+
reason: hotUpdate.reason,
|
|
17009
|
+
declinedBy: hotUpdate.declinedBy
|
|
17010
|
+
});
|
|
17011
|
+
} else {
|
|
17012
|
+
notifyAccepted({
|
|
17013
|
+
cause: `${relativeUrl} ${event}`,
|
|
17014
|
+
reason: hotUpdate.reason,
|
|
17015
|
+
instructions: hotUpdate.instructions
|
|
17016
|
+
});
|
|
17017
|
+
}
|
|
17018
|
+
};
|
|
17006
17019
|
|
|
17007
|
-
|
|
17008
|
-
|
|
17020
|
+
urlGraph.urlInfoMap.forEach(urlInfo => {
|
|
17021
|
+
if (urlInfo.url === url) {
|
|
17022
|
+
onUrlInfo(urlInfo);
|
|
17023
|
+
} else {
|
|
17024
|
+
const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
|
|
17009
17025
|
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
});
|
|
17016
|
-
} else {
|
|
17017
|
-
notifyAccepted({
|
|
17018
|
-
cause: `${relativeUrl} ${event}`,
|
|
17019
|
-
reason: hotUpdate.reason,
|
|
17020
|
-
instructions: hotUpdate.instructions
|
|
17021
|
-
});
|
|
17022
|
-
}
|
|
17026
|
+
if (urlWithoutSearch === url) {
|
|
17027
|
+
onUrlInfo(urlInfo);
|
|
17028
|
+
}
|
|
17029
|
+
}
|
|
17030
|
+
});
|
|
17023
17031
|
});
|
|
17024
17032
|
clientFilesPruneCallbackList.push((prunedUrlInfos, firstUrlInfo) => {
|
|
17025
17033
|
const mainHotUpdate = propagateUpdate(firstUrlInfo);
|
package/package.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
urlIsInsideOf,
|
|
3
|
+
urlToRelativeUrl,
|
|
4
|
+
asUrlWithoutSearch,
|
|
5
|
+
} from "@jsenv/urls"
|
|
2
6
|
|
|
3
7
|
export const jsenvPluginAutoreloadServer = ({
|
|
4
8
|
clientFileChangeCallbackList,
|
|
@@ -113,26 +117,33 @@ export const jsenvPluginAutoreloadServer = ({
|
|
|
113
117
|
return iterate(firstUrlInfo, seen)
|
|
114
118
|
}
|
|
115
119
|
clientFileChangeCallbackList.push(({ url, event }) => {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
reason: hotUpdate.reason,
|
|
133
|
-
instructions: hotUpdate.instructions,
|
|
134
|
-
})
|
|
120
|
+
const onUrlInfo = (urlInfo) => {
|
|
121
|
+
const relativeUrl = formatUrlForClient(url)
|
|
122
|
+
const hotUpdate = propagateUpdate(urlInfo)
|
|
123
|
+
if (hotUpdate.declined) {
|
|
124
|
+
notifyDeclined({
|
|
125
|
+
cause: `${relativeUrl} ${event}`,
|
|
126
|
+
reason: hotUpdate.reason,
|
|
127
|
+
declinedBy: hotUpdate.declinedBy,
|
|
128
|
+
})
|
|
129
|
+
} else {
|
|
130
|
+
notifyAccepted({
|
|
131
|
+
cause: `${relativeUrl} ${event}`,
|
|
132
|
+
reason: hotUpdate.reason,
|
|
133
|
+
instructions: hotUpdate.instructions,
|
|
134
|
+
})
|
|
135
|
+
}
|
|
135
136
|
}
|
|
137
|
+
urlGraph.urlInfoMap.forEach((urlInfo) => {
|
|
138
|
+
if (urlInfo.url === url) {
|
|
139
|
+
onUrlInfo(urlInfo)
|
|
140
|
+
} else {
|
|
141
|
+
const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url)
|
|
142
|
+
if (urlWithoutSearch === url) {
|
|
143
|
+
onUrlInfo(urlInfo)
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
})
|
|
136
147
|
})
|
|
137
148
|
clientFilesPruneCallbackList.push((prunedUrlInfos, firstUrlInfo) => {
|
|
138
149
|
const mainHotUpdate = propagateUpdate(firstUrlInfo)
|