rollipop 0.1.0-alpha.5 → 0.1.0-alpha.7

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # rollipop
2
2
 
3
+ ## 0.1.0-alpha.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 66477ec: implement deferred caching with batch flush
8
+ - 646d819: resolve HMR not working when cache is enabled
9
+ - 78a57d4: add dotenv-based environment variable loading
10
+
11
+ ## 0.1.0-alpha.6
12
+
13
+ ### Patch Changes
14
+
15
+ - a7b7150: use `enqueueUpdate` instead of `performReactRefresh`
16
+
3
17
  ## 0.1.0-alpha.5
4
18
 
5
19
  ### Patch Changes
package/client.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  interface ImportMeta {
2
2
  hot?: import('./dist').HMRContext;
3
+ env: ImportMetaEnv;
3
4
  }
@@ -81,6 +81,9 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
81
81
  function _array_with_holes(arr) {
82
82
  if (Array.isArray(arr)) return arr;
83
83
  }
84
+ function _array_without_holes(arr) {
85
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
86
+ }
84
87
  function _assert_this_initialized(self) {
85
88
  if (self === void 0) {
86
89
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -127,6 +130,9 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
127
130
  } });
128
131
  if (superClass) _set_prototype_of(subClass, superClass);
129
132
  }
133
+ function _iterable_to_array(iter) {
134
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
135
+ }
130
136
  function _iterable_to_array_limit(arr, i) {
131
137
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
132
138
  if (_i == null) return;
@@ -154,6 +160,9 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
154
160
  function _non_iterable_rest() {
155
161
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
156
162
  }
163
+ function _non_iterable_spread() {
164
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
165
+ }
157
166
  function _possible_constructor_return(self, call) {
158
167
  if (call && (_type_of(call) === "object" || typeof call === "function")) {
159
168
  return call;
@@ -170,6 +179,9 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
170
179
  function _sliced_to_array(arr, i) {
171
180
  return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
172
181
  }
182
+ function _to_consumable_array(arr) {
183
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
184
+ }
173
185
  function _type_of(obj) {
174
186
  "@swc/helpers - typeof";
175
187
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
@@ -482,6 +494,7 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
482
494
  var message = JSON.parse(event.data);
483
495
  if (isCustomHMRMessage(message)) {
484
496
  var _globalThis___ROLLIPOP_CUSTOM_HMR_HANDLER__, _globalThis;
497
+ debug("[HMR]: Custom HMR message received: ".concat(message.type));
485
498
  _this.socketHolder.emit(message.type, message.payload);
486
499
  (_globalThis___ROLLIPOP_CUSTOM_HMR_HANDLER__ = (_globalThis = __ROLLIPOP_GLOBAL__).__ROLLIPOP_CUSTOM_HMR_HANDLER__) === null || _globalThis___ROLLIPOP_CUSTOM_HMR_HANDLER__ === void 0 ? void 0 : _globalThis___ROLLIPOP_CUSTOM_HMR_HANDLER__.call(_globalThis, socket, message);
487
500
  return;
@@ -500,6 +513,7 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
500
513
  {
501
514
  key: "evaluate",
502
515
  value: function evaluate(code, sourceURL) {
516
+ debug("[HMR]: Evaluating code\n".concat(code));
503
517
  if (__ROLLIPOP_GLOBAL__.globalEvalWithSourceUrl) {
504
518
  __ROLLIPOP_GLOBAL__.globalEvalWithSourceUrl(code, sourceURL);
505
519
  } else {
@@ -510,6 +524,7 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
510
524
  {
511
525
  key: "reload",
512
526
  value: function reload() {
527
+ debug("[HMR]: Reloading");
513
528
  var moduleName = "DevSettings";
514
529
  (__ROLLIPOP_GLOBAL__.__turboModuleProxy ? __ROLLIPOP_GLOBAL__.__turboModuleProxy(moduleName) : __ROLLIPOP_GLOBAL__.nativeModuleProxy[moduleName]).reload();
515
530
  }
@@ -517,6 +532,15 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
517
532
  ]);
518
533
  return ReactNativeDevRuntime1;
519
534
  }(BaseDevRuntime);
535
+ function debug() {
536
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
537
+ args[_key] = arguments[_key];
538
+ }
539
+ if (process.env.DEBUG_ROLLIPOP) {
540
+ var _console;
541
+ (_console = console).log.apply(_console, _to_consumable_array(args));
542
+ }
543
+ }
520
544
  function isCustomHMRMessage(message) {
521
545
  if ((typeof message === "undefined" ? "undefined" : _type_of(message)) !== "object" || message == null) {
522
546
  return false;