Skip to content

refactor: add g3-only markers to replace specific g3 patches#68871

Open
alxhub wants to merge 1 commit into
angular:mainfrom
alxhub:internal-g3-only
Open

refactor: add g3-only markers to replace specific g3 patches#68871
alxhub wants to merge 1 commit into
angular:mainfrom
alxhub:internal-g3-only

Conversation

@alxhub
Copy link
Copy Markdown
Member

@alxhub alxhub commented May 21, 2026

Replace specific file patches applied during google3 sync with a generic comment-based mechanism.

By adding // g3-only: prefix comments to g3-specific exports and declarations, and appending google3 only context to @internal tags, we enable generic tooling to handle these modifications during the sync process. This reduces the need for maintaining custom file-specific patches in google3.

Specifically:

  • Add g3-only context to @internal in directives.ts for foreignImports and deferredImports.
  • Add // g3-only: commented exports in core.ts.
  • Add // g3-only: commented global declaration in zone.ts.

TAG=agy
CONV=cd09a4f3-869a-4f41-949b-c91f1b8f1c51

@alxhub alxhub force-pushed the internal-g3-only branch 2 times, most recently from 186c817 to 2dcc359 Compare May 21, 2026 20:28
@pullapprove pullapprove Bot requested a review from tbondwilkinson May 21, 2026 20:28
@angular-robot angular-robot Bot added the requires: TGP This PR requires a passing TGP before merging is allowed label May 21, 2026
@alxhub alxhub force-pushed the internal-g3-only branch 2 times, most recently from 5868124 to 36d1c89 Compare May 21, 2026 21:06
@pullapprove pullapprove Bot requested a review from josephperrott May 21, 2026 21:06
Replace specific file patches applied during google3 sync with generic comment-based mechanisms.

By adding `// g3-only` prefix comments to g3-specific exports and declarations, and appending `// 3p-only` context to `@internal` tags, we enable generic tooling to handle these modifications during the sync process.

Additionally, wrap 3rd-party-only imports and exports (which should be stripped in google3) with `// 3p-only-start` and `// 3p-only-end` comment markers.

This reduces the need for maintaining custom file-specific patches in google3.

Also, add a comprehensive guide to these sync comment markers in `contributing-docs/google-markers.md` to assist external contributors.

Specifically:
- Add `// 3p-only` context to `@internal` in `directives.ts` for `foreignImports` and `deferredImports`.
- Add `// g3-only` commented exports in `core.ts`.
- Add `// g3-only-start`/`// g3-only-end` commented global declaration block in `zone.ts`.
- Wrap 3p-only imports in `fake_navigation.ts` with `// 3p-only-start` and `// 3p-only-end`.
- Wrap 3p-only exports in `compiler-cli/index.ts` with `// 3p-only-start` and `// 3p-only-end`.
- Add `// g3-only` and `// 3p-only` markers to `shared.ts` for `setDisabledStateDefault` configuration.
- Add `// g3-only` and `// 3p-only` markers to `feature_detection.ts` for semver dependency.
- Add `// g3-only` and `// 3p-only` markers to `domino_adapter.ts` for domino import path.
- Add `contributing-docs/google-markers.md` guide.

TAG=agy
CONV=cd09a4f3-869a-4f41-949b-c91f1b8f1c51
@alxhub alxhub force-pushed the internal-g3-only branch from 36d1c89 to 9234126 Compare May 21, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires: TGP This PR requires a passing TGP before merging is allowed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant