@xh/hoist 79.0.0-SNAPSHOT.1767028297274 → 79.0.0-SNAPSHOT.1767040663589

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
@@ -54,6 +54,11 @@
54
54
  * `RelativeTimestampProps.options` - provide directly as top-level props
55
55
 
56
56
  * Improved the efficiency and logging of MsalClient.
57
+ * Improved protections against running stale versions of client app code.
58
+
59
+ * Grid performance optimizations introduced on an experimental basis. See
60
+ `GridExperimentalFlags.deltaSort` and `GridExperimentalFlags.disableScrollOptimization`
61
+
57
62
 
58
63
  ### 📚 Libraries
59
64
  * react-grid-layout `1.5.0 → 2.1.1`
@@ -40,7 +40,7 @@ import {
40
40
  TrackService,
41
41
  WebSocketService
42
42
  } from '@xh/hoist/svc';
43
- import {checkMinVersion, createSingleton, throwIf} from '@xh/hoist/utils/js';
43
+ import {createSingleton, throwIf} from '@xh/hoist/utils/js';
44
44
  import {compact, isEmpty} from 'lodash';
45
45
  import {AboutDialogModel} from './AboutDialogModel';
46
46
  import {BannerSourceModel} from './BannerSourceModel';
@@ -60,7 +60,6 @@ import {AppStateModel} from './AppStateModel';
60
60
  import {PageStateModel} from './PageStateModel';
61
61
  import {RouterModel} from './RouterModel';
62
62
  import {installServicesAsync} from '../core/impl/InstallServices';
63
- import {MIN_HOIST_CORE_VERSION} from '../core/XH';
64
63
 
65
64
  /**
66
65
  * Root object for Framework GUI State.
@@ -237,13 +236,6 @@ export class AppContainerModel extends HoistModel {
237
236
  await installServicesAsync(TrackService);
238
237
  await installServicesAsync([EnvironmentService, PrefService, JsonBlobService]);
239
238
 
240
- // Confirm hoist-core version after environment service loaded.
241
- const hcVersion = XH.getEnv('hoistCoreVersion');
242
- throwIf(
243
- !checkMinVersion(hcVersion, MIN_HOIST_CORE_VERSION),
244
- `This version of Hoist React requires the server to run Hoist Core ≥ v${MIN_HOIST_CORE_VERSION}. Version ${hcVersion} detected.`
245
- );
246
-
247
239
  await installServicesAsync([
248
240
  AlertBannerService,
249
241
  AutoRefreshService,
@@ -28,8 +28,6 @@ export declare class EnvironmentService extends HoistService {
28
28
  get appEnvironment(): AppEnvironment;
29
29
  isProduction(): boolean;
30
30
  isTest(): boolean;
31
- isMinHoistCoreVersion(version: string): boolean;
32
- isMaxHoistCoreVersion(version: string): boolean;
33
31
  /**
34
32
  * Update critical environment information from server, including current app version + build,
35
33
  * upgrade prompt mode, and alert banner.
@@ -38,6 +36,7 @@ export declare class EnvironmentService extends HoistService {
38
36
  */
39
37
  pollServerAsync(): Promise<void>;
40
38
  constructor();
39
+ private ensureVersionRunnable;
41
40
  private startPolling;
42
41
  private setServerInfo;
43
42
  private get pollIntervalMs();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "79.0.0-SNAPSHOT.1767028297274",
3
+ "version": "79.0.0-SNAPSHOT.1767040663589",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -11,10 +11,11 @@ import {action, makeObservable, observable} from '@xh/hoist/mobx';
11
11
  import hoistPkg from '@xh/hoist/package.json';
12
12
  import {Timer} from '@xh/hoist/utils/async';
13
13
  import {MINUTES, SECONDS} from '@xh/hoist/utils/datetime';
14
- import {checkMaxVersion, checkMinVersion, deepFreeze} from '@xh/hoist/utils/js';
14
+ import {checkMinVersion, deepFreeze, throwIf} from '@xh/hoist/utils/js';
15
15
  import {defaults, isFinite} from 'lodash';
16
16
  import mobxPkg from 'mobx/package.json';
17
17
  import {version as reactVersion} from 'react';
18
+ import {MIN_HOIST_CORE_VERSION} from '../core/XH';
18
19
 
19
20
  /**
20
21
  * Load and report on the client and server environment, including software versions, timezones, and
@@ -78,6 +79,8 @@ export class EnvironmentService extends HoistService {
78
79
 
79
80
  this.setServerInfo(instanceName, serverEnv.appVersion, serverEnv.appBuild);
80
81
 
82
+ this.ensureVersionRunnable();
83
+
81
84
  this.pollConfig = pollConfig;
82
85
  this.addReaction({
83
86
  when: () => XH.appIsRunning,
@@ -104,14 +107,6 @@ export class EnvironmentService extends HoistService {
104
107
  return this.appEnvironment === 'Test';
105
108
  }
106
109
 
107
- isMinHoistCoreVersion(version: string): boolean {
108
- return checkMinVersion(this.get('hoistCoreVersion'), version);
109
- }
110
-
111
- isMaxHoistCoreVersion(version: string): boolean {
112
- return checkMaxVersion(this.get('hoistCoreVersion'), version);
113
- }
114
-
115
110
  /**
116
111
  * Update critical environment information from server, including current app version + build,
117
112
  * upgrade prompt mode, and alert banner.
@@ -165,6 +160,31 @@ export class EnvironmentService extends HoistService {
165
160
  makeObservable(this);
166
161
  }
167
162
 
163
+ private ensureVersionRunnable() {
164
+ const hcVersion = this.get('hoistCoreVersion'),
165
+ clientVersion = this.get('appVersion'),
166
+ serverVersion = this.serverVersion;
167
+
168
+ // Check for client/server mismatch version. It's an ok transitory state *during* the
169
+ // client app lifetime, but app should *never* start this way, would indicate caching issue.
170
+ throwIf(
171
+ clientVersion != serverVersion,
172
+ XH.exception(
173
+ `The version of this client (${clientVersion}) is out of sync with the
174
+ available server (${serverVersion}). Please reload to continue.`
175
+ )
176
+ );
177
+
178
+ // Confirm hoist-core/react version mismatch (developer issue)
179
+ throwIf(
180
+ !checkMinVersion(hcVersion, MIN_HOIST_CORE_VERSION),
181
+ XH.exception(
182
+ `This version of Hoist React requires the server to run
183
+ Hoist Core ≥ v${MIN_HOIST_CORE_VERSION}. Version ${hcVersion} detected.`
184
+ )
185
+ );
186
+ }
187
+
168
188
  private startPolling() {
169
189
  this.pollTimer = Timer.create({
170
190
  runFn: () => this.pollServerAsync(),