Skip to content

Commit ddadb8e

Browse files
benleshIgorMinar
authored andcommitted
refactor(ivy): Update @publicapi to @codeGenApi on ivy instructions (angular#29820)
- Removes `@publicApi` annotation from ivy instructions - Adds new `@codeGenApi` annotation to ivy instructions - Updates ts_api_guardian to support the new annotation properly PR Close angular#29820
1 parent def73a6 commit ddadb8e

32 files changed

+142
-127
lines changed

packages/core/src/render3/definition.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let _renderCompCount = 0;
3939
* });
4040
* }
4141
* ```
42-
* @publicApi
42+
* @codeGenApi
4343
*/
4444
export function ΔdefineComponent<T>(componentDefinition: {
4545
/**
@@ -305,7 +305,7 @@ export function ΔdefineComponent<T>(componentDefinition: {
305305
}
306306

307307
/**
308-
* @publicApi
308+
* @codeGenApi
309309
*/
310310
export function ΔsetComponentScope(
311311
type: ComponentType<any>, directives: Type<any>[], pipes: Type<any>[]): void {
@@ -332,7 +332,7 @@ export function extractPipeDef(type: PipeType<any>): PipeDef<any> {
332332
}
333333

334334
/**
335-
* @publicApi
335+
* @codeGenApi
336336
*/
337337
export function ΔdefineNgModule<T>(def: {
338338
/** Token representing the module. Used by DI. */
@@ -376,7 +376,7 @@ export function ΔdefineNgModule<T>(def: {
376376
* marked pure to tree-shake it from the bundle, allowing for all referenced declarations
377377
* to become eligible for tree-shaking as well.
378378
*
379-
* @publicApi
379+
* @codeGenApi
380380
*/
381381
export function ΔsetNgModuleScope(type: any, scope: {
382382
/** List of components, directives, and pipes declared by this module. */
@@ -488,7 +488,7 @@ function invertObject<T>(
488488
*
489489
* @param baseDefinition The base definition parameters
490490
*
491-
* @publicApi
491+
* @codeGenApi
492492
*/
493493
export function ΔdefineBase<T>(baseDefinition: {
494494
/**
@@ -570,7 +570,7 @@ export function ΔdefineBase<T>(baseDefinition: {
570570
* }
571571
* ```
572572
*
573-
* @publicApi
573+
* @codeGenApi
574574
*/
575575
export const ΔdefineDirective = ΔdefineComponent as any as<T>(directiveDefinition: {
576576
/**
@@ -688,7 +688,7 @@ export const ΔdefineDirective = ΔdefineComponent as any as<T>(directiveDefinit
688688
* ```
689689
* @param pipeDef Pipe definition generated by the compiler
690690
*
691-
* @publicApi
691+
* @codeGenApi
692692
*/
693693
export function ΔdefinePipe<T>(pipeDef: {
694694
/** Name of the pipe. Used for matching pipes in template to pipe defs. */

packages/core/src/render3/di.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ export class NodeInjector implements Injector {
635635
}
636636

637637
/**
638-
* @publicApi
638+
* @codeGenApi
639639
*/
640640
export function ΔgetFactoryOf<T>(type: Type<any>): ((type: Type<T>| null) => T)|null {
641641
const typeAny = type as any;
@@ -648,7 +648,7 @@ export function ΔgetFactoryOf<T>(type: Type<any>): ((type: Type<T>| null) => T)
648648
}
649649

650650
/**
651-
* @publicApi
651+
* @codeGenApi
652652
*/
653653
export function ΔgetInheritedFactory<T>(type: Type<any>): (type: Type<T>) => T {
654654
const proto = Object.getPrototypeOf(type.prototype).constructor as Type<any>;

packages/core/src/render3/features/inherit_definition_feature.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function getSuperType(type: Type<any>): Type<any>&
2424
* Merges the definition from a super class to a sub class.
2525
* @param definition The definition that is a SubClass of another directive of component
2626
*
27-
* @publicApi
27+
* @codeGenApi
2828
*/
2929
export function ΔInheritDefinitionFeature(definition: DirectiveDef<any>| ComponentDef<any>): void {
3030
let superType = getSuperType(definition.type);

packages/core/src/render3/features/ng_onchanges_feature.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type OnChangesExpando = OnChanges & {
3939
* });
4040
* ```
4141
*
42-
* @publicApi
42+
* @codeGenApi
4343
*/
4444
export function ΔNgOnChangesFeature<T>(): DirectiveDefFeature {
4545
// This option ensures that the ngOnChanges lifecycle hook will be inherited

packages/core/src/render3/features/providers_feature.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {DirectiveDef} from '../interfaces/definition';
3737
*
3838
* @param definition
3939
*
40-
* @publicApi
40+
* @codeGenApi
4141
*/
4242
export function ΔProvidersFeature<T>(providers: Provider[], viewProviders: Provider[] = []) {
4343
return (definition: DirectiveDef<T>) => {

packages/core/src/render3/i18n.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ const parentIndexStack: number[] = [];
347347
* @param message The translation message.
348348
* @param subTemplateIndex Optional sub-template index in the `message`.
349349
*
350-
* @publicApi
350+
* @codeGenApi
351351
*/
352352
export function Δi18nStart(index: number, message: string, subTemplateIndex?: number): void {
353353
const tView = getLView()[TVIEW];
@@ -534,7 +534,7 @@ function appendI18nNode(tNode: TNode, parentTNode: TNode, previousTNode: TNode |
534534
*
535535
* @returns Transformed string that can be consumed by i18nStart instruction
536536
*
537-
* @publicApi
537+
* @codeGenApi
538538
*/
539539
export function Δi18nPostprocess(
540540
message: string, replacements: {[key: string]: (string | string[])} = {}): string {
@@ -630,7 +630,7 @@ export function Δi18nPostprocess(
630630
* Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes
631631
* into the render tree, moves the placeholder nodes and removes the deleted nodes.
632632
*
633-
* @publicApi
633+
* @codeGenApi
634634
*/
635635
export function Δi18nEnd(): void {
636636
const tView = getLView()[TVIEW];
@@ -919,7 +919,7 @@ function removeNode(index: number, viewData: LView) {
919919
* @param message The translation message.
920920
* @param subTemplateIndex Optional sub-template index in the `message`.
921921
*
922-
* @publicApi
922+
* @codeGenApi
923923
*/
924924
export function Δi18n(index: number, message: string, subTemplateIndex?: number): void {
925925
Δi18nStart(index, message, subTemplateIndex);
@@ -932,7 +932,7 @@ export function Δi18n(index: number, message: string, subTemplateIndex?: number
932932
* @param index A unique index in the static block
933933
* @param values
934934
*
935-
* @publicApi
935+
* @codeGenApi
936936
*/
937937
export function Δi18nAttributes(index: number, values: string[]): void {
938938
const tView = getLView()[TVIEW];
@@ -984,7 +984,7 @@ let shiftsCounter = 0;
984984
*
985985
* @param expression The binding's new value or NO_CHANGE
986986
*
987-
* @publicApi
987+
* @codeGenApi
988988
*/
989989
export function Δi18nExp<T>(expression: T | NO_CHANGE): void {
990990
if (expression !== NO_CHANGE) {
@@ -999,7 +999,7 @@ export function Δi18nExp<T>(expression: T | NO_CHANGE): void {
999999
* @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}
10001000
* (i18n attribute) on which it should update the content.
10011001
*
1002-
* @publicApi
1002+
* @codeGenApi
10031003
*/
10041004
export function Δi18nApply(index: number) {
10051005
if (shiftsCounter) {

packages/core/src/render3/instructions/alloc_host_vars.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {NO_CHANGE} from '../tokens';
1717
*
1818
* @param count Amount of vars to be allocated
1919
*
20-
* @publicApi
20+
* @codeGenApi
2121
*/
2222
export function ΔallocHostVars(count: number): void {
2323
const lView = getLView();

packages/core/src/render3/instructions/container.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {addToViewTree, createDirectivesAndLocals, createLContainer, createNodeAt
2828
*
2929
* @param index The index of the container in the data array
3030
*
31-
* @publicApi
31+
* @codeGenApi
3232
*/
3333
export function Δcontainer(index: number): void {
3434
const tNode = containerInternal(index, null, null);
@@ -57,7 +57,7 @@ export function Δcontainer(index: number): void {
5757
* @param localRefExtractor A function which extracts local-refs values from the template.
5858
* Defaults to the current element associated with the local-ref.
5959
*
60-
* @publicApi
60+
* @codeGenApi
6161
*/
6262
export function Δtemplate(
6363
index: number, templateFn: ComponentTemplate<any>| null, consts: number, vars: number,
@@ -85,7 +85,7 @@ export function Δtemplate(
8585
*
8686
* @param index The index of the container in the data array
8787
*
88-
* @publicApi
88+
* @codeGenApi
8989
*/
9090
export function ΔcontainerRefreshStart(index: number): void {
9191
const lView = getLView();
@@ -108,7 +108,7 @@ export function ΔcontainerRefreshStart(index: number): void {
108108
*
109109
* Marking the end of LContainer is the time when to child views get inserted or removed.
110110
*
111-
* @publicApi
111+
* @codeGenApi
112112
*/
113113
export function ΔcontainerRefreshEnd(): void {
114114
let previousOrParentTNode = getPreviousOrParentTNode();

packages/core/src/render3/instructions/di.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {getLView, getPreviousOrParentTNode} from '../state';
3333
* @param flags Injection flags
3434
* @returns the value from the injector or `null` when not found
3535
*
36-
* @publicApi
36+
* @codeGenApi
3737
*/
3838
export function ΔdirectiveInject<T>(token: Type<T>| InjectionToken<T>): T;
3939
export function ΔdirectiveInject<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags): T;
@@ -48,7 +48,7 @@ export function ΔdirectiveInject<T>(
4848
/**
4949
* Facade for the attribute injection from DI.
5050
*
51-
* @publicApi
51+
* @codeGenApi
5252
*/
5353
export function ΔinjectAttribute(attrNameToInject: string): string|null {
5454
return injectAttributeImpl(getPreviousOrParentTNode(), attrNameToInject);

packages/core/src/render3/instructions/element.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {getActiveDirectiveStylingIndex} from './styling';
4242
* hold an attribute name and elements with an odd index hold an attribute value, ex.:
4343
* ['id', 'warning5', 'class', 'alert']
4444
*
45-
* @publicApi
45+
* @codeGenApi
4646
*/
4747
export function ΔelementStart(
4848
index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {
@@ -127,7 +127,7 @@ export function ΔelementStart(
127127
/**
128128
* Mark the end of the element.
129129
*
130-
* @publicApi
130+
* @codeGenApi
131131
*/
132132
export function ΔelementEnd(): void {
133133
let previousOrParentTNode = getPreviousOrParentTNode();
@@ -179,7 +179,7 @@ export function ΔelementEnd(): void {
179179
* element on creation. Use [AttributeMarker] to denote the meaning of this array.
180180
* @param localRefs A set of local reference bindings on the element.
181181
*
182-
* @publicApi
182+
* @codeGenApi
183183
*/
184184
export function Δelement(
185185
index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {
@@ -198,7 +198,7 @@ export function Δelement(
198198
* @param sanitizer An optional function used to sanitize the value.
199199
* @param namespace Optional namespace to use when setting the attribute.
200200
*
201-
* @publicApi
201+
* @codeGenApi
202202
*/
203203
export function ΔelementAttribute(
204204
index: number, name: string, value: any, sanitizer?: SanitizerFn | null,
@@ -266,7 +266,7 @@ export function ΔelementAttribute(
266266
* @param attrs An array of static values (attributes, classes and styles) with the correct marker
267267
* values.
268268
*
269-
* @publicApi
269+
* @codeGenApi
270270
*/
271271
export function ΔelementHostAttrs(attrs: TAttributes) {
272272
const hostElementIndex = getSelectedIndex();

packages/core/src/render3/instructions/element_container.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {createDirectivesAndLocals, createNodeAtIndex, executeContentQueries, set
2929
* the DOM (as a comment node can't have attributes). Attributes are here only for directive
3030
* matching purposes and setting initial inputs of directives.
3131
*
32-
* @publicApi
32+
* @codeGenApi
3333
*/
3434
export function ΔelementContainerStart(
3535
index: number, attrs?: TAttributes | null, localRefs?: string[] | null): void {
@@ -70,7 +70,7 @@ export function ΔelementContainerStart(
7070
/**
7171
* Mark the end of the <ng-container>.
7272
*
73-
* @publicApi
73+
* @codeGenApi
7474
*/
7575
export function ΔelementContainerEnd(): void {
7676
let previousOrParentTNode = getPreviousOrParentTNode();

packages/core/src/render3/instructions/embedded_view.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import {assignTViewNodeToLView, createLView, createTView, refreshDescendantViews
2323
*
2424
* @param viewBlockId The ID of this view
2525
* @return boolean Whether or not this view is in creation mode
26-
*
27-
* @publicApi
26+
*
27+
* @codeGenApi
2828
*/
2929
export function ΔembeddedViewStart(viewBlockId: number, consts: number, vars: number): RenderFlags {
3030
const lView = getLView();
@@ -127,7 +127,7 @@ function scanForView(lContainer: LContainer, startIdx: number, viewBlockId: numb
127127
/**
128128
* Marks the end of an embedded view.
129129
*
130-
* @publicApi
130+
* @codeGenApi
131131
*/
132132
export function ΔembeddedViewEnd(): void {
133133
const lView = getLView();

packages/core/src/render3/instructions/get_current_view.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {getLView} from '../state';
1515
* of the current view and restore it when listeners are invoked. This allows
1616
* walking the declaration view tree in listeners to get vars from parent views.
1717
*
18-
* @publicApi
18+
* @codeGenApi
1919
*/
2020
export function ΔgetCurrentView(): OpaqueViewState {
2121
return getLView() as any as OpaqueViewState;

packages/core/src/render3/instructions/listener.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {BindingDirection, generatePropertyAliases, getCleanup, handleError, load
2929
* @param eventTargetResolver Function that returns global target information in case this listener
3030
* should be attached to a global object like window, document or body
3131
*
32-
* @publicApi
32+
* @codeGenApi
3333
*/
3434
export function Δlistener(
3535
eventName: string, listenerFn: (e?: any) => any, useCapture = false,
@@ -56,7 +56,7 @@ export function Δlistener(
5656
* @param eventTargetResolver Function that returns global target information in case this listener
5757
* should be attached to a global object like window, document or body
5858
*
59-
* @publicApi
59+
* @codeGenApi
6060
*/
6161
export function ΔcomponentHostSyntheticListener<T>(
6262
eventName: string, listenerFn: (e?: any) => any, useCapture = false,

packages/core/src/render3/instructions/next_context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {nextContextImpl} from '../state';
1717
* @param level The relative level of the view from which to grab context compared to contextVewData
1818
* @returns context
1919
*
20-
* @publicApi
20+
* @codeGenApi
2121
*/
2222
export function ΔnextContext<T = any>(level: number = 1): T {
2323
return nextContextImpl(level);

packages/core/src/render3/instructions/projection.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {createNodeAtIndex} from './shared';
3737
* @param selectors A collection of parsed CSS selectors
3838
* @param rawSelectors A collection of CSS selectors in the raw, un-parsed form
3939
*
40-
* @publicApi
40+
* @codeGenApi
4141
*/
4242
export function ΔprojectionDef(selectors?: CssSelectorList[]): void {
4343
const componentNode = findComponentView(getLView())[T_HOST] as TElementNode;
@@ -76,7 +76,7 @@ export function ΔprojectionDef(selectors?: CssSelectorList[]): void {
7676
* - 0 when the selector is `*` (or unspecified as this is the default value),
7777
* - 1 based index of the selector from the {@link projectionDef}
7878
*
79-
* @publicApi
79+
* @codeGenApi
8080
*/
8181
export function Δprojection(
8282
nodeIndex: number, selectorIndex: number = 0, attrs?: TAttributes): void {

0 commit comments

Comments
 (0)