next.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. "use strict";
  2. exports.__esModule = true;
  3. var _exportNames = {
  4. batch: true
  5. };
  6. Object.defineProperty(exports, "batch", {
  7. enumerable: true,
  8. get: function () {
  9. return _reactBatchedUpdates.unstable_batchedUpdates;
  10. }
  11. });
  12. var React = _interopRequireWildcard(require("react"));
  13. var _withSelector = require("use-sync-external-store/with-selector");
  14. var _reactBatchedUpdates = require("./utils/reactBatchedUpdates");
  15. var _batch = require("./utils/batch");
  16. var _useSelector = require("./hooks/useSelector");
  17. var _connect = require("./components/connect");
  18. var _exports = require("./exports");
  19. Object.keys(_exports).forEach(function (key) {
  20. if (key === "default" || key === "__esModule") return;
  21. if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  22. if (key in exports && exports[key] === _exports[key]) return;
  23. Object.defineProperty(exports, key, {
  24. enumerable: true,
  25. get: function () {
  26. return _exports[key];
  27. }
  28. });
  29. });
  30. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  31. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  32. // The secondary entry point assumes we are working with React 18, and thus have
  33. // useSyncExternalStore available. We can import that directly from React itself.
  34. // The useSyncExternalStoreWithSelector has to be imported, but we can use the
  35. // non-shim version. This shaves off the byte size of the shim.
  36. (0, _useSelector.initializeUseSelector)(_withSelector.useSyncExternalStoreWithSelector);
  37. (0, _connect.initializeConnect)(React.useSyncExternalStore); // Enable batched updates in our subscriptions for use
  38. // with standard React renderers (ReactDOM, React Native)
  39. (0, _batch.setBatch)(_reactBatchedUpdates.unstable_batchedUpdates);