Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

refactor(compiler): account for pipes without names #61328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented May 14, 2025

Updates the compiler logic to account for pipe definitions that may not have names.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels May 14, 2025
@angular-robot angular-robot bot added area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the framework runtime labels May 14, 2025
@ngbot ngbot bot added this to the Backlog milestone May 14, 2025
@crisbeto crisbeto marked this pull request as ready for review May 14, 2025 11:26
@pullapprove pullapprove bot requested a review from atscott May 14, 2025 11:27
export declare class PipeWithoutName implements PipeTransform {
transform(value: unknown): unknown;
static ɵfac: i0.ɵɵFactoryDeclaration<PipeWithoutName, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<PipeWithoutName, null, true>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, do you have thoughts this output appearing in projects using an older compiler version? I don't fully recall what our version guarantees here are (which way, backwards, forward etc.).

Likely simply not picking up the pipe metadata is the expected behavior here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm not entirely sure either, but I suspect that we don't support this sort of backwards compatibility.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's probably fine because there is no way to reference the pipe nicely "without" a name; but might be worth double-checking with others.

Worst-case, we could roll out changes to older compilers and error if we discover a nameless pipe when collecting metadata for a symbol via .d.ts

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reporting an error when used with older compilers can be done by changing the minVersion value of the partial declaration, that's what it's designed for.

}
}
PipeWithoutName.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: PipeWithoutName, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
PipeWithoutName.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: PipeWithoutName, isStandalone: true, name: "PipeWithoutName" });
Copy link
Member

@devversion devversion May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, just to be safe, you did choose the name to be still emitted for backwards compatibility of such "nameless pipe" partial compilation output, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I left it for backwards compatibility and because this is the name that the runtime will use to "match" pipes.

@pullapprove pullapprove bot requested a review from devversion May 14, 2025 14:43
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from alxhub May 14, 2025 14:44
@pullapprove pullapprove bot requested a review from atscott May 14, 2025 16:39
@crisbeto
Copy link
Member Author

Passing TGP

Copy link
Member

@pkozlowski-opensource pkozlowski-opensource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: public-api
Reviewed-for: fw-general

@angular-robot angular-robot bot removed the area: core Issues related to the framework runtime label May 17, 2025
@crisbeto
Copy link
Member Author

crisbeto commented May 17, 2025

There were some discussions over whether we want to do the public API change now. I've dropped it for the moment and will leave the rest of the compiler code so that we can easily make the switch later.

@crisbeto crisbeto removed request for atscott and alxhub May 17, 2025 06:58
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label May 17, 2025
@crisbeto crisbeto changed the title Optional pipe names refactor(compiler): account for pipes without names May 17, 2025
@crisbeto crisbeto removed the action: review The PR is still awaiting reviews from at least one requested reviewer label May 17, 2025
@crisbeto crisbeto force-pushed the anonymous-pipes branch 2 times, most recently from 6daab46 to 9a873cc Compare May 17, 2025 07:18
Updates the compiler logic to account for pipe definitions that may not have names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.