@rollipop/core 0.1.0-alpha.0 → 0.1.0-alpha.2
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/CHANGELOG.md +19 -0
- package/dist/{chunk-BYW8Mqxw.js → chunk-DJulfCLt.js} +2 -1
- package/dist/hmr-client.cjs +7 -4
- package/dist/hmr-runtime.js +2 -3
- package/dist/index.cjs +2511 -82
- package/dist/index.d.cts +304 -66
- package/dist/index.d.ts +307 -67
- package/dist/index.js +2497 -82
- package/dist/runtime.cjs +18 -0
- package/dist/runtime.d.cts +55 -0
- package/dist/runtime.d.ts +55 -0
- package/dist/runtime.js +17 -0
- package/package.json +27 -6
- package/dist/hmr-shims.js +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @rollipop/core
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e8d32a7: improve `configureServer` hook
|
|
8
|
+
- 8118bc3: bind plugin context to rollipop custom hooks
|
|
9
|
+
- 5cee54c: supports custom HMR handler
|
|
10
|
+
- 4768f8f: add `configureServer`
|
|
11
|
+
- Updated dependencies [8118bc3]
|
|
12
|
+
- @rollipop/common@0.1.0-alpha.2
|
|
13
|
+
|
|
14
|
+
## 0.1.0-alpha.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- e21eeb5: ensure valid source mapping information is included in serve mode
|
|
19
|
+
- 3d72e91: add `config` and `configResolved` for plugins
|
|
20
|
+
- @rollipop/common@0.1.0-alpha.1
|
|
21
|
+
|
|
3
22
|
## 0.1.0-alpha.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -2,6 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
|
|
3
3
|
//#region rolldown:runtime
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
5
6
|
var __export = (all, symbols) => {
|
|
6
7
|
let target = {};
|
|
7
8
|
for (var name in all) {
|
|
@@ -18,4 +19,4 @@ var __export = (all, symbols) => {
|
|
|
18
19
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
19
20
|
|
|
20
21
|
//#endregion
|
|
21
|
-
export {
|
|
22
|
+
export { __export as n, __require as r, __commonJSMin as t };
|
package/dist/hmr-client.cjs
CHANGED
|
@@ -160,9 +160,9 @@ var HMRClient = class HMRClient {
|
|
|
160
160
|
this.flushEarlyLogs();
|
|
161
161
|
}
|
|
162
162
|
handleConnectionError(error, origin) {
|
|
163
|
-
let errorMessage = "Cannot connect to
|
|
163
|
+
let errorMessage = "Cannot connect to Rollipop.\n\n" + "Try the following to fix the issue:\n" + "- Ensure that Rollipop is running and available on the same network";
|
|
164
164
|
if (Platform.OS === "ios") {
|
|
165
|
-
errorMessage += "- Ensure that the
|
|
165
|
+
errorMessage += "- Ensure that the Rollipop URL is correctly set in AppDelegate";
|
|
166
166
|
} else {
|
|
167
167
|
errorMessage += `- Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices\n` + `- If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device\n` + `- If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:8081`;
|
|
168
168
|
}
|
|
@@ -195,13 +195,16 @@ var HMRClient = class HMRClient {
|
|
|
195
195
|
this.compileErrorMessage = data.payload.message;
|
|
196
196
|
this.showCompileErrorIfNeeded();
|
|
197
197
|
break;
|
|
198
|
+
default:
|
|
199
|
+
__ROLLIPOP_GLOBAL__.__ROLLIPOP_CUSTOM_HMR_HANDLER__?.(data);
|
|
200
|
+
break;
|
|
198
201
|
}
|
|
199
202
|
}
|
|
200
203
|
handleClose(event) {
|
|
201
204
|
const { code, reason } = event;
|
|
202
205
|
const isNormalOrUnsetCloseReason = code === 1e3 || code === 1005;
|
|
203
|
-
const message = isNormalOrUnsetCloseReason ? "Disconnected from
|
|
204
|
-
this.unavailableMessage ??= message + "\n\n" + "To reconnect:\n" + "- Ensure that
|
|
206
|
+
const message = isNormalOrUnsetCloseReason ? "Disconnected from Rollipop." : `Disconnected from Rollipop (${code}: "${reason}").`;
|
|
207
|
+
this.unavailableMessage ??= message + "\n\n" + "To reconnect:\n" + "- Ensure that Rollipop is running and available on the same network\n" + "- Reload this app (will trigger further help if Rollipop cannot be connected to)\n";
|
|
205
208
|
this.showUnavailableMessageIfNeeded();
|
|
206
209
|
}
|
|
207
210
|
};
|
package/dist/hmr-runtime.js
CHANGED
|
@@ -36,9 +36,8 @@ function enqueueUpdate() {
|
|
|
36
36
|
var BaseDevRuntime = DevRuntime;
|
|
37
37
|
var ModuleHotContext = class {
|
|
38
38
|
acceptCallbacks = [];
|
|
39
|
-
constructor(moduleId
|
|
39
|
+
constructor(moduleId) {
|
|
40
40
|
this.moduleId = moduleId;
|
|
41
|
-
this.devRuntime = devRuntime;
|
|
42
41
|
}
|
|
43
42
|
get refresh() {
|
|
44
43
|
return __ROLLIPOP_GLOBAL__.__ReactRefresh;
|
|
@@ -87,7 +86,7 @@ var ReactNativeDevRuntime = class ReactNativeDevRuntime extends BaseDevRuntime {
|
|
|
87
86
|
super(messenger);
|
|
88
87
|
}
|
|
89
88
|
createModuleHotContext(moduleId) {
|
|
90
|
-
const hotContext = new ModuleHotContext(moduleId
|
|
89
|
+
const hotContext = new ModuleHotContext(moduleId);
|
|
91
90
|
if (this.moduleHotContexts.has(moduleId)) {
|
|
92
91
|
this.moduleHotContextsToBeUpdated.set(moduleId, hotContext);
|
|
93
92
|
} else {
|