@devvit/ui-renderer 0.10.5-next-2023-09-13-6d7ac39ba.0 → 0.10.5-next-2023-09-13-9614c694a.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"devvit-custom-post.d.ts","sourceRoot":"","sources":["../../library/src/client/devvit-custom-post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAIvD,OAAO,kEAAkE,CAAC;AAG1E,OAAO,KAAK,EAOV,YAAY,EACZ,QAAQ,EAER,MAAM,EAGP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,EAML,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAItF,OAAO,gDAAgD,CAAC;AACxD,OAAO,+CAA+C,CAAC;AACvD,OAAO,8BAA8B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF;AASD,qBACa,gBAAiB,SAAQ,UAAU;;IAE9C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAGpB,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAG/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,UAAU,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAG9B,gBAAgB,CAAC,EAAE,IAAI,CAAC;IAGxB,MAAM,CAAC,EAAE,YAAY,CAAC;IAGtB,UAAU,EAAE,OAAO,CAAQ;IAG3B,qBAAqB,EAAE,OAAO,CAAS;IAGvC,cAAc,CAAC,EAAE,oBAAoB,CAAC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E,YAAY,CAAC;IAGtB,UAAU,EAAE,OAAO,CAAQ;IAG3B,qBAAqB,EAAE,OAAO,CAAS;IAGvC,cAAc,CAAC,EAAE,oBAAoB,CAAC;IAGtC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IAGpC,SAAS,CAAC,EAAE,KAAK,CAAC;IAelB,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAOhC,QAAQ,IAAI,IAAI;IAIP,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;cASZ,UAAU,CAAC,iBAAiB,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC5E,MAAM;CAoJhB"}
@@ -18,7 +18,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
18
18
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
19
19
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
20
20
  };
21
- var _DevvitCustomPost_instances, _DevvitCustomPost_appState, _DevvitCustomPost_lastRequest, _DevvitCustomPost_rootHeight, _DevvitCustomPost_customPostActor, _DevvitCustomPost_uiEventHandlerActor, _DevvitCustomPost_rpcQueue, _DevvitCustomPost_rerenderTimeout, _DevvitCustomPost_state_get, _DevvitCustomPost_makeRenderContext, _DevvitCustomPost_handleUIEvent, _DevvitCustomPost_handleUserAction, _DevvitCustomPost_renderRequest, _DevvitCustomPost_initialRender, _DevvitCustomPost_userActionRender, _DevvitCustomPost_effectEventRender, _DevvitCustomPost_renderPost, _DevvitCustomPost_handleEffects;
21
+ var _DevvitCustomPost_instances, _DevvitCustomPost_appState, _DevvitCustomPost_lastRequest, _DevvitCustomPost_rootHeight, _DevvitCustomPost_hasInitialRender, _DevvitCustomPost_hostname, _DevvitCustomPost_customPostActor, _DevvitCustomPost_uiEventHandlerActor, _DevvitCustomPost_rpcQueue, _DevvitCustomPost_rerenderTimeout, _DevvitCustomPost_state_get, _DevvitCustomPost_makeRenderContext, _DevvitCustomPost_handleUIEvent, _DevvitCustomPost_handleUserAction, _DevvitCustomPost_renderRequest, _DevvitCustomPost_initialRender, _DevvitCustomPost_userActionRender, _DevvitCustomPost_effectEventRender, _DevvitCustomPost_renderPost, _DevvitCustomPost_handleEffects;
22
22
  import { html, LitElement } from 'lit';
23
23
  import { customElement, property, query, state } from 'lit/decorators.js';
24
24
  import PQueue from 'p-queue';
@@ -41,6 +41,8 @@ let DevvitCustomPost = class DevvitCustomPost extends LitElement {
41
41
  _DevvitCustomPost_appState.set(this, {});
42
42
  _DevvitCustomPost_lastRequest.set(this, void 0);
43
43
  _DevvitCustomPost_rootHeight.set(this, void 0);
44
+ _DevvitCustomPost_hasInitialRender.set(this, false);
45
+ _DevvitCustomPost_hostname.set(this, void 0);
44
46
  _DevvitCustomPost_customPostActor.set(this, void 0);
45
47
  _DevvitCustomPost_uiEventHandlerActor.set(this, void 0);
46
48
  _DevvitCustomPost_rpcQueue.set(this, new PQueue({ concurrency: 1 }));
@@ -111,9 +113,11 @@ let DevvitCustomPost = class DevvitCustomPost extends LitElement {
111
113
  actorRefChanged = true;
112
114
  }
113
115
  let bundleChanged = false;
114
- if (changedProperties.has('bundle')) {
116
+ let appChanged = false;
117
+ if (changedProperties.has('bundle') && this.bundle?.hostname !== __classPrivateFieldGet(this, _DevvitCustomPost_hostname, "f")) {
115
118
  this.localClient?.quit();
116
119
  bundleChanged = true;
120
+ appChanged = true;
117
121
  }
118
122
  let experimentalChanged = false;
119
123
  if (changedProperties.has('useExperimentalBlocks')) {
@@ -124,7 +128,7 @@ let DevvitCustomPost = class DevvitCustomPost extends LitElement {
124
128
  // offline/online, defer initialRender for offline client
125
129
  await this.localClient?.loadBundle(this.bundle, this.useSandbox);
126
130
  }
127
- else {
131
+ else if (appChanged || !__classPrivateFieldGet(this, _DevvitCustomPost_hasInitialRender, "f")) {
128
132
  // online only
129
133
  __classPrivateFieldGet(this, _DevvitCustomPost_instances, "m", _DevvitCustomPost_initialRender).call(this);
130
134
  }
@@ -145,11 +149,12 @@ let DevvitCustomPost = class DevvitCustomPost extends LitElement {
145
149
  </devvit-blocks-renderer>`;
146
150
  }
147
151
  };
148
- _DevvitCustomPost_appState = new WeakMap(), _DevvitCustomPost_lastRequest = new WeakMap(), _DevvitCustomPost_rootHeight = new WeakMap(), _DevvitCustomPost_customPostActor = new WeakMap(), _DevvitCustomPost_uiEventHandlerActor = new WeakMap(), _DevvitCustomPost_rpcQueue = new WeakMap(), _DevvitCustomPost_rerenderTimeout = new WeakMap(), _DevvitCustomPost_makeRenderContext = new WeakMap(), _DevvitCustomPost_handleUIEvent = new WeakMap(), _DevvitCustomPost_handleUserAction = new WeakMap(), _DevvitCustomPost_renderRequest = new WeakMap(), _DevvitCustomPost_instances = new WeakSet(), _DevvitCustomPost_state_get = function _DevvitCustomPost_state_get() {
152
+ _DevvitCustomPost_appState = new WeakMap(), _DevvitCustomPost_lastRequest = new WeakMap(), _DevvitCustomPost_rootHeight = new WeakMap(), _DevvitCustomPost_hasInitialRender = new WeakMap(), _DevvitCustomPost_hostname = new WeakMap(), _DevvitCustomPost_customPostActor = new WeakMap(), _DevvitCustomPost_uiEventHandlerActor = new WeakMap(), _DevvitCustomPost_rpcQueue = new WeakMap(), _DevvitCustomPost_rerenderTimeout = new WeakMap(), _DevvitCustomPost_makeRenderContext = new WeakMap(), _DevvitCustomPost_handleUIEvent = new WeakMap(), _DevvitCustomPost_handleUserAction = new WeakMap(), _DevvitCustomPost_renderRequest = new WeakMap(), _DevvitCustomPost_instances = new WeakSet(), _DevvitCustomPost_state_get = function _DevvitCustomPost_state_get() {
149
153
  const data = { __postData: { thingId: this.postId, config: this.postConfig } };
150
154
  return Object.assign({}, __classPrivateFieldGet(this, _DevvitCustomPost_appState, "f"), data);
151
155
  }, _DevvitCustomPost_initialRender = function _DevvitCustomPost_initialRender() {
152
156
  __classPrivateFieldSet(this, _DevvitCustomPost_rootHeight, undefined, "f");
157
+ __classPrivateFieldSet(this, _DevvitCustomPost_hasInitialRender, true, "f");
153
158
  __classPrivateFieldGet(this, _DevvitCustomPost_instances, "m", _DevvitCustomPost_renderPost).call(this, __classPrivateFieldGet(this, _DevvitCustomPost_renderRequest, "f").call(this, BlockRenderEventType.RENDER_INITIAL));
154
159
  }, _DevvitCustomPost_userActionRender = function _DevvitCustomPost_userActionRender(actionId, data = {}) {
155
160
  __classPrivateFieldGet(this, _DevvitCustomPost_instances, "m", _DevvitCustomPost_renderPost).call(this, __classPrivateFieldGet(this, _DevvitCustomPost_renderRequest, "f").call(this, BlockRenderEventType.RENDER_USER_ACTION, actionId, data));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/ui-renderer",
3
- "version": "0.10.5-next-2023-09-13-6d7ac39ba.0",
3
+ "version": "0.10.5-next-2023-09-13-9614c694a.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "types": "./index.d.ts",
50
50
  "dependencies": {
51
- "@devvit/protos": "0.10.5-next-2023-09-13-6d7ac39ba.0",
52
- "@devvit/runtime-lite": "0.10.5-next-2023-09-13-6d7ac39ba.0",
53
- "@devvit/runtimes": "0.10.5-next-2023-09-13-6d7ac39ba.0",
51
+ "@devvit/protos": "0.10.5-next-2023-09-13-9614c694a.0",
52
+ "@devvit/runtime-lite": "0.10.5-next-2023-09-13-9614c694a.0",
53
+ "@devvit/runtimes": "0.10.5-next-2023-09-13-9614c694a.0",
54
54
  "@lottiefiles/lottie-player": "1.7.1",
55
55
  "p-queue": "7.3.4",
56
56
  "rxjs": "7.5.7"
@@ -77,7 +77,7 @@
77
77
  "devDependencies": {
78
78
  "@devvit/eslint-config": "0.10.4",
79
79
  "@devvit/repo-tools": "0.10.4",
80
- "@devvit/tsconfig": "0.10.5-next-2023-09-13-6d7ac39ba.0",
80
+ "@devvit/tsconfig": "0.10.5-next-2023-09-13-9614c694a.0",
81
81
  "@lit/localize": "0.11.4",
82
82
  "@open-wc/testing-helpers": "2.3.0",
83
83
  "@reddit/baseplate": "0.14.0",
@@ -102,5 +102,5 @@
102
102
  "directory": "dist"
103
103
  },
104
104
  "source": "./src/index.ts",
105
- "gitHead": "a159aa483ac15a86ee0b9793b6566d77de19363e"
105
+ "gitHead": "13adb3e21fa09f0ae7f12b7ea9dfe9e3a6d57a8e"
106
106
  }