@atlaskit/react-ufo 4.2.6 → 4.3.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/additional-payload/package.json +1 -1
  3. package/bundle-eval-timing/package.json +1 -1
  4. package/coinflip/package.json +1 -1
  5. package/common/package.json +1 -1
  6. package/config/package.json +1 -1
  7. package/create-experimental-interaction-metrics-payload/package.json +1 -1
  8. package/create-payload/package.json +1 -1
  9. package/create-post-interaction-log-payload/package.json +1 -1
  10. package/custom-cohort-data/package.json +1 -1
  11. package/custom-data/package.json +1 -1
  12. package/custom-mark/package.json +1 -1
  13. package/custom-spans/package.json +1 -1
  14. package/custom-timings/package.json +1 -1
  15. package/dist/cjs/config/index.js +39 -24
  16. package/dist/cjs/create-payload/index.js +13 -5
  17. package/dist/cjs/interaction-metrics/index.js +1 -0
  18. package/dist/es2019/config/index.js +14 -0
  19. package/dist/es2019/create-payload/index.js +11 -1
  20. package/dist/es2019/interaction-metrics/index.js +2 -1
  21. package/dist/esm/config/index.js +38 -24
  22. package/dist/esm/create-payload/index.js +13 -5
  23. package/dist/esm/interaction-metrics/index.js +2 -1
  24. package/dist/types/common/common/types.d.ts +2 -0
  25. package/dist/types/config/index.d.ts +24 -0
  26. package/dist/types/create-payload/index.d.ts +25346 -146
  27. package/dist/types-ts4.5/common/common/types.d.ts +2 -0
  28. package/dist/types-ts4.5/config/index.d.ts +24 -0
  29. package/dist/types-ts4.5/create-payload/index.d.ts +25346 -146
  30. package/experience-trace-id-context/package.json +1 -1
  31. package/feature-flags-accessed/package.json +1 -1
  32. package/generate-id/package.json +1 -1
  33. package/global-error-handler/package.json +1 -1
  34. package/hidden-timing/package.json +1 -1
  35. package/initial-page-load-extra-timing/package.json +1 -1
  36. package/interaction-context/package.json +1 -1
  37. package/interaction-id-context/package.json +1 -1
  38. package/interaction-ignore/package.json +1 -1
  39. package/interaction-metrics/package.json +1 -1
  40. package/interaction-metrics-init/package.json +1 -1
  41. package/label/package.json +1 -1
  42. package/load-hold/package.json +1 -1
  43. package/package.json +1 -1
  44. package/placeholder/package.json +1 -1
  45. package/resource-timing/package.json +1 -1
  46. package/round-number/package.json +1 -1
  47. package/route-name/package.json +1 -1
  48. package/route-name-context/package.json +1 -1
  49. package/segment/package.json +1 -1
  50. package/set-interaction-error/package.json +1 -1
  51. package/short-id/package.json +1 -1
  52. package/ssr/package.json +1 -1
  53. package/ssr-scripts/package.json +1 -1
  54. package/suspense/package.json +1 -1
  55. package/trace-interaction/package.json +1 -1
  56. package/trace-pageload/package.json +1 -1
  57. package/trace-press/package.json +1 -1
  58. package/trace-redirect/package.json +1 -1
  59. package/trace-transition/package.json +1 -1
  60. package/typing-performance-tracing/package.json +1 -1
  61. package/use-press-tracing/package.json +1 -1
  62. package/vc/package.json +1 -1
  63. package/vc-media/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import type { ReactHydrationStats } from '../../config';
1
2
  import type { TraceIdContext } from '../../experience-trace-id-context';
2
3
  import type { LabelStack, UFOInteractionContextType } from '../../interaction-context';
3
4
  import type { VCObserverInterface } from '../../vc/types';
@@ -162,6 +163,7 @@ export interface InteractionMetrics {
162
163
  vcObserver?: VCObserverInterface;
163
164
  experimentalVCObserver?: VCObserverInterface;
164
165
  vc?: VCRawDataType | null;
166
+ hydration?: ReactHydrationStats;
165
167
  experimentalTTAI?: number;
166
168
  experimentalVC90?: number;
167
169
  unknownElementName?: string;
@@ -32,6 +32,24 @@ type Rates = {
32
32
  };
33
33
  export type TTVCRevision = 'fy25.01' | 'fy25.02' | 'fy25.03';
34
34
  export declare const DEFAULT_TTVC_REVISION = "fy25.03";
35
+ export type ReactHydrationStats = {
36
+ /**
37
+ * Indicates if hydration of SSR content failed, so React switching to client-side rendering and re-rendered from scratch.
38
+ */
39
+ successful: boolean;
40
+ /**
41
+ * The total number of hydration errors reported from {@code hydrateRoot#onRecoverableError}.
42
+ */
43
+ warningCount?: number;
44
+ /**
45
+ * The depth in the React component tree of the shallowest warning.
46
+ */
47
+ minWarningComponentDepth?: number;
48
+ /**
49
+ * The depth in the React component tree of the deepest warning.
50
+ */
51
+ maxWarningComponentDepth?: number;
52
+ };
35
53
  export type Config = {
36
54
  readonly enabled?: boolean;
37
55
  readonly interactionTimeout?: Record<string, number>;
@@ -115,12 +133,18 @@ export type Config = {
115
133
  readonly shouldCalculateLighthouseMetricsFromTTAI?: boolean;
116
134
  readonly timeWindowForLateMutationsInMilliseconds?: number;
117
135
  readonly manuallyTrackReactProfilerMounts?: boolean;
136
+ /**
137
+ * Callback for consumers to provide React hydration stats after React has finished.
138
+ * Return {@code null} if hydration was not attempted or if we do not want to report any stats.
139
+ */
140
+ readonly getReactHydrationStats?: (() => ReactHydrationStats | undefined) | undefined;
118
141
  };
119
142
  export declare function setUFOConfig(newConfig: Config): void;
120
143
  export declare function getConfig(): Config | undefined;
121
144
  export declare function getEnabledVCRevisions(experienceKey?: string): readonly TTVCRevision[];
122
145
  export declare function isVCRevisionEnabled(revision: TTVCRevision, experienceKey?: string): boolean;
123
146
  export declare function getMostRecentVCRevision(experienceKey?: string): TTVCRevision;
147
+ export declare function getReactHydrationStats(): ReactHydrationStats | undefined;
124
148
  export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
125
149
  export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
126
150
  export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;