refactor: add g3-only markers to replace specific g3 patches#68871
Open
alxhub wants to merge 1 commit into
Open
refactor: add g3-only markers to replace specific g3 patches#68871alxhub wants to merge 1 commit into
alxhub wants to merge 1 commit into
Conversation
186c817 to
2dcc359
Compare
5868124 to
36d1c89
Compare
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 appendinggoogle3 onlycontext to@internaltags, 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:
g3-onlycontext to@internalindirectives.tsforforeignImportsanddeferredImports.// g3-only:commented exports incore.ts.// g3-only:commented global declaration inzone.ts.TAG=agy
CONV=cd09a4f3-869a-4f41-949b-c91f1b8f1c51