Skip to content

Commit

Permalink
Update api reports
Browse files Browse the repository at this point in the history
  • Loading branch information
janechu committed Jul 5, 2024
1 parent aa57005 commit e285630
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 123 deletions.
101 changes: 14 additions & 87 deletions packages/web-components/fast-element/docs/api-report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,41 +279,25 @@ export class ElementController<TElement extends HTMLElement = HTMLElement> exten
constructor(element: TElement, definition: FASTElementDefinition);
addBehavior(behavior: HostBehavior<TElement>): void;
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
// (undocumented)
protected behaviors: Map<HostBehavior<TElement>, number> | null;
// (undocumented)
protected bindObservables(): void;
connect(): void;
// (undocumented)
protected connectBehaviors(): void;
get context(): ExecutionContext;
readonly definition: FASTElementDefinition;
disconnect(): void;
// (undocumented)
protected disconnectBehaviors(): void;
emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
static forCustomElement(element: HTMLElement): ElementController;
get isBound(): boolean;
get isConnected(): boolean;
get mainStyles(): ElementStyles | null;
set mainStyles(value: ElementStyles | null);
// (undocumented)
protected needsInitialization: boolean;
onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
onUnbind(behavior: {
unbind(controller: ExpressionController<TElement>): any;
}): void;
removeBehavior(behavior: HostBehavior<TElement>, force?: boolean): void;
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
// (undocumented)
protected renderTemplate(template: ElementViewTemplate | null | undefined): void;
static setStrategy(strategy: ElementControllerStrategy): void;
readonly source: TElement;
get sourceLifetime(): SourceLifetime | undefined;
// Warning: (ae-forgotten-export) The symbol "Stages" needs to be exported by the entry point index.d.ts
//
// (undocumented)
protected stage: Stages;
get template(): ElementViewTemplate<TElement> | null;
set template(value: ElementViewTemplate<TElement> | null);
readonly view: ElementView<TElement> | null;
Expand Down Expand Up @@ -539,33 +523,41 @@ export interface HTMLDirectiveDefinition<TType extends Constructable<HTMLDirecti
// @public
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
// (undocumented)
readonly factories: CompiledViewBehaviorFactory[];
}

// @public
export type HTMLTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]) => ViewTemplate<TSource, TParent>) & {
partial(html: string): InlineTemplateDirective;
};

// Warning: (ae-forgotten-export) The symbol "DefaultExecutionContext" needs to be exported by the entry point index.d.ts
//
// @public
export class HTMLView<TSource = any, TParent = any> extends DefaultExecutionContext<TParent> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
constructor(fragment: DocumentFragment, factories: ReadonlyArray<CompiledViewBehaviorFactory>, targets: ViewBehaviorTargets);
appendTo(node: Node): void;
bind(source: TSource, context?: ExecutionContext<TParent>): void;
context: ExecutionContext<TParent>;
dispose(): void;
static disposeContiguousBatch(views: SyntheticView[]): void;
get event(): Event;
eventDetail<TDetail>(): TDetail;
eventTarget<TTarget extends EventTarget>(): TTarget;
firstChild: Node;
index: number;
insertBefore(node: Node): void;
isBound: boolean;
get isEven(): boolean;
get isFirst(): boolean;
get isInMiddle(): boolean;
get isLast(): boolean;
get isOdd(): boolean;
lastChild: Node;
length: number;
// (undocumented)
onUnbind(behavior: {
unbind(controller: ViewController<TSource, TParent>): void;
unbind(controller: ViewController<TSource, TParent>): any;
}): void;
readonly parent: TParent;
readonly parentContext: ExecutionContext<TParent>;
remove(): void;
source: TSource | null;
readonly sourceLifetime: SourceLifetime;
Expand All @@ -574,43 +566,6 @@ export class HTMLView<TSource = any, TParent = any> extends DefaultExecutionCont
unbind(): void;
}

// @beta
export class HydratableElementController<TElement extends HTMLElement = HTMLElement> extends ElementController<TElement> {
// (undocumented)
connect(): void;
// (undocumented)
disconnect(): void;
// (undocumented)
static install(): void;
protected needsHydration?: boolean;
}

// @public (undocumented)
export interface HydratableView<TSource = any, TParent = any> extends ElementView, SyntheticView, DefaultExecutionContext<TParent> {
// (undocumented)
[Hydratable]: symbol;
// Warning: (ae-forgotten-export) The symbol "ViewNodes" needs to be exported by the entry point index.d.ts
//
// (undocumented)
readonly bindingViewBoundaries: Record<string, ViewNodes>;
// Warning: (ae-forgotten-export) The symbol "HydrationStage" needs to be exported by the entry point index.d.ts
//
// (undocumented)
readonly hydrationStage: keyof typeof HydrationStage;
}

// @public (undocumented)
export class HydrationBindingError extends Error {
constructor(
message: string | undefined,
factory: ViewBehaviorFactory,
fragment: DocumentFragment,
templateString: string);
readonly factory: ViewBehaviorFactory;
readonly fragment: DocumentFragment;
readonly templateString: string;
}

// @public
export class InlineTemplateDirective implements HTMLDirective {
constructor(html: string, factories?: Record<string, ViewBehaviorFactory>);
Expand Down Expand Up @@ -741,32 +696,6 @@ export class RefDirective extends StatelessAttachedAttributeDirective<string> {
targetNodeId: string;
}

// @public
export function render<TSource = any, TItem = any, TParent = any>(value?: Expression<TSource, TItem> | Binding<TSource, TItem> | {}, template?: ContentTemplate | string | Expression<TSource, ContentTemplate | string | Node, TParent> | Binding<TSource, ContentTemplate | string | Node, TParent>): CaptureType<TSource, TParent>;

// @public
export class RenderBehavior<TSource = any> implements ViewBehavior, Subscriber {
constructor(directive: RenderDirective);
bind(controller: ViewController): void;
// @internal (undocumented)
handleChange(source: any, observer: ExpressionObserver): void;
unbind(controller: ViewController): void;
}

// @public
export class RenderDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory, BindingDirective {
constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, ContentTemplate>, templateBindingDependsOnData: boolean);
createBehavior(): RenderBehavior<TSource>;
createHTML(add: AddViewBehaviorFactory): string;
// (undocumented)
readonly dataBinding: Binding<TSource>;
targetNodeId: string;
// (undocumented)
readonly templateBinding: Binding<TSource, ContentTemplate>;
// (undocumented)
readonly templateBindingDependsOnData: boolean;
}

// @public
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>, TParent = any>(items: Expression<TSource, TArray, TParent> | Binding<TSource, TArray, TParent> | ReadonlyArray<any>, template: Expression<TSource, ViewTemplate<any, TSource>> | Binding<TSource, ViewTemplate<any, TSource>> | ViewTemplate<any, TSource>, options?: RepeatOptions): CaptureType<TSource, TParent>;

Expand Down Expand Up @@ -993,8 +922,6 @@ export interface ViewController<TSource = any, TParent = any> extends Expression
// @public
export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> {
constructor(html: string | HTMLTemplateElement, factories?: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy | undefined);
// @internal (undocumented)
compile(): HTMLTemplateCompilationResult<TSource, TParent>;
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?: DOMPolicy): ViewTemplate<TSource, TParent>;
readonly factories: Record<string, ViewBehaviorFactory>;
Expand Down
48 changes: 12 additions & 36 deletions packages/web-components/fast-ssr/docs/api-report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
/// <reference types="node" />

import { AsyncLocalStorage } from 'async_hooks';
import { Binding } from '@microsoft/fast-element';
import { ComposableStyles } from '@microsoft/fast-element';
import { Constructable } from '@microsoft/fast-element';
import { Disposable } from '@microsoft/fast-element';
import { DOMContainer } from '@microsoft/fast-element/di.js';
import { EventEmitter } from 'node:events';
import { ExecutionContext } from '@microsoft/fast-element';
import { FASTElement } from '@microsoft/fast-element';
import { FASTElementDefinition } from '@microsoft/fast-element';
import { HostController } from '@microsoft/fast-element';
import { TemplateCacheController } from '../template-cache/controller.js';
import { ViewBehaviorFactory } from '@microsoft/fast-element';
import { ViewTemplate } from '@microsoft/fast-element';

Expand All @@ -28,12 +26,10 @@ export interface AsyncElementRenderer extends Omit<ElementRenderer, "renderShado
}

// @beta (undocumented)
export interface AsyncTemplateRenderer extends EventEmitter {
export interface AsyncTemplateRenderer {
// (undocumented)
createRenderInfo(): RenderInfo;
// (undocumented)
readonly emitHydratableMarkup: boolean;
// (undocumented)
render(template: ViewTemplate | string, renderInfo?: RenderInfo, source?: unknown, context?: ExecutionContext): IterableIterator<string | Promise<string>>;
// (undocumented)
withDefaultElementRenderers(...renderers: ConstructableElementRenderer<AsyncElementRenderer>[]): void;
Expand Down Expand Up @@ -65,8 +61,6 @@ export interface ElementRenderer {
// (undocumented)
connectedCallback(): void;
// (undocumented)
disconnectedCallback(): void;
// (undocumented)
dispatchEvent(event: Event): boolean;
// (undocumented)
renderAttributes(): IterableIterator<string>;
Expand Down Expand Up @@ -109,13 +103,11 @@ export default fastSSR;
export type Middleware = (req: any, res: any, next: () => any) => void;

// @beta (undocumented)
export interface RenderInfo extends Disposable {
// @deprecated
customElementHostStack: ElementRenderer[];
customElementInstanceStack: ElementRenderer[];
export type RenderInfo = {
elementRenderers: ConstructableElementRenderer[];
renderedCustomElementList: ElementRenderer[];
}
customElementInstanceStack: ElementRenderer[];
customElementHostStack: ElementRenderer[];
};

// @beta
export const RequestStorage: Readonly<{
Expand All @@ -133,44 +125,36 @@ export const RequestStorageManager: Readonly<{
installDOMShim(): void;
uninstallDOMShim(): void;
installDIContextRequestStrategy(): void;
createStorage(options?: StorageOptions, req?: any): Map<any, any>;
createStorage(options?: StorageOptions): Map<any, any>;
run<T = unknown>(storage: Map<any, any>, callback: () => T): T;
middleware(options?: StorageOptions): Middleware;
}>;

// @beta
export interface SSRConfiguration {
deferHydration?: boolean | ((tagName: string) => boolean);
emitHydratableMarkup?: boolean;
deferHydration?: boolean;
renderMode?: "sync" | "async";
styleRenderer?: StyleRenderer;
tryRecoverFromError?: boolean | ((e: unknown) => void);
viewBehaviorFactoryRenderers?: ViewBehaviorFactoryRenderer<any>[];
}

// @beta
export type StorageOptions = {
createWindow?: (req: any) => {
createWindow?: () => {
[key: string]: unknown;
};
storage?: Map<any, any>;
};

// @beta
export interface StyleRenderer {
render(styles: Set<string | CSSStyleSheet>): string;
render(styles: ComposableStyles): string;
}

// @public (undocumented)
export const templateCacheController: TemplateCacheController;

// @beta (undocumented)
export interface TemplateRenderer extends EventEmitter {
export interface TemplateRenderer {
// (undocumented)
createRenderInfo(): RenderInfo;
// (undocumented)
readonly emitHydratableMarkup: boolean;
// (undocumented)
render(template: ViewTemplate | string, renderInfo?: RenderInfo, source?: unknown, context?: ExecutionContext): IterableIterator<string>;
// (undocumented)
withDefaultElementRenderers(...renderers: ConstructableElementRenderer[]): void;
Expand All @@ -185,17 +169,9 @@ export interface ViewBehaviorFactoryRenderer<T extends ViewBehaviorFactory> {

// Warnings were encountered during analysis:
//
<<<<<<< HEAD:packages/web-components/fast-ssr/docs/api-report.api.md
// dist/dts/exports.d.ts:41:5 - (ae-forgotten-export) The symbol "SyncFASTElementRenderer" needs to be exported by the entry point exports.d.ts
// dist/dts/exports.d.ts:56:5 - (ae-forgotten-export) The symbol "AsyncFASTElementRenderer" needs to be exported by the entry point exports.d.ts
// dist/dts/request-storage.d.ts:33:5 - (ae-forgotten-export) The symbol "getItem" needs to be exported by the entry point exports.d.ts
=======
// dist/dts/exports.d.ts:60:5 - (ae-forgotten-export) The symbol "SyncFASTElementRenderer" needs to be exported by the entry point exports.d.ts
// dist/dts/exports.d.ts:63:5 - (ae-incompatible-release-tags) The symbol "templateRenderer" is marked as @public, but its signature references "TemplateRenderer" which is marked as @beta
// dist/dts/exports.d.ts:64:5 - (ae-incompatible-release-tags) The symbol "ElementRenderer" is marked as @public, but its signature references "ConstructableFASTElementRenderer" which is marked as @beta
// dist/dts/exports.d.ts:74:5 - (ae-forgotten-export) The symbol "AsyncFASTElementRenderer" needs to be exported by the entry point exports.d.ts
// dist/dts/request-storage.d.ts:32:5 - (ae-forgotten-export) The symbol "getItem" needs to be exported by the entry point exports.d.ts
>>>>>>> 9a90dab8e (Adds support for FASTElement hydration):packages/web-components/fast-ssr/docs/api-report.md

// (No @packageDocumentation comment for this package)

Expand Down

0 comments on commit e285630

Please sign in to comment.