@stoker-platform/web-app 0.5.210 → 0.5.211

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,11 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.211
4
+
5
+ ### Patch Changes
6
+
7
+ - perf: improve Record page performance
8
+
3
9
  ## 0.5.210
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.210",
3
+ "version": "0.5.211",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
package/src/Record.tsx CHANGED
@@ -36,6 +36,10 @@ import { Breadcrumbs } from "./Breadcrumbs"
36
36
  import { Separator } from "./components/ui/separator"
37
37
  import { loadAssigning } from "./utils/relationListFiltersState"
38
38
 
39
+ const customPageComponents = import.meta.glob("./components/ui/*.tsx", { eager: true })
40
+ const customPageHooks = import.meta.glob("./hooks/*.{ts,tsx}", { eager: true })
41
+ const customPageUtils = import.meta.glob("./lib/*.{ts,tsx}", { eager: true })
42
+
39
43
  export const Record = ({ collection }: { collection: CollectionSchema }) => {
40
44
  const { labels, fields, recordTitleField } = collection
41
45
  const { path: pathString, id } = useParams()
@@ -207,7 +211,9 @@ export const Record = ({ collection }: { collection: CollectionSchema }) => {
207
211
  </Button>
208
212
  </Card>
209
213
  <Card className="flex items-center gap-2 h-12 min-w-[300px] p-5">
210
- <div>{icon ? createElement(icon) : null}</div>
214
+ <div className="flex size-6 shrink-0 items-center justify-center">
215
+ {icon ? createElement(icon) : null}
216
+ </div>
211
217
  <h1 className="truncate">{recordTitle}</h1>
212
218
  </Card>
213
219
  </header>
@@ -346,11 +352,9 @@ export const Record = ({ collection }: { collection: CollectionSchema }) => {
346
352
  {createElement(page.component, {
347
353
  record,
348
354
  collection,
349
- components: import.meta.glob("./components/ui/*.tsx", {
350
- eager: true,
351
- }),
352
- hooks: import.meta.glob("./hooks/*.{ts,tsx}", { eager: true }),
353
- utils: import.meta.glob("./lib/*.{ts,tsx}", { eager: true }),
355
+ components: customPageComponents,
356
+ hooks: customPageHooks,
357
+ utils: customPageUtils,
354
358
  ...page.props,
355
359
  })}
356
360
  </main>
@@ -30,7 +30,7 @@ export const getRelationFields = (collection: CollectionSchema) => {
30
30
  if (refs.length === 0) continue
31
31
  const titleField = field.titleField
32
32
  if (
33
- (!fieldCustomization.admin?.condition?.form || condition) &&
33
+ (fieldCustomization.admin?.condition?.form === undefined || condition) &&
34
34
  (!(titleField && field.includeFields?.includes(titleField)) || queryFullRecord)
35
35
  ) {
36
36
  relationFields.push(field.name)