Skip to content

Commit

Permalink
[i18n DevTool Deprecation Issue] (5) Document new deprecation process
Browse files Browse the repository at this point in the history
This documents the way to introduce translated deprecation issues like
(3) and (4) did. It will cover the entire process e2e and be updated as
changes are made. The legacy process will not be documented.

This CL is part of a series:
(1) Remove legacy info
(2) Translate issue title
(3) Translate demo Issue {CHROMIUM}
(4) Translate demo Issue {DEVTOOLS}
(5) Document new deprecation process
(6) Translate more Issues ...

Bug: 1264960
Change-Id: If388a85574a3986ab8187b5c55ad31088f2aff55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3572967
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#989289}
  • Loading branch information
arichiv authored and Chromium LUCI CQ committed Apr 6, 2022
1 parent 6170d59 commit 3ff7ec8
Showing 1 changed file with 103 additions and 0 deletions.
103 changes: 103 additions & 0 deletions third_party/blink/renderer/core/frame/deprecation/README.md
@@ -0,0 +1,103 @@
# Deprecation

This README serves as documentation of the way chrome developers can alert web developers to their use of deprecated/removed features.
These alerts can include information on the deprecated feature, alternate features to use, and the removal timeline.
Follow the steps below to dispatch alerts via the [DevTools Issues](https://developer.chrome.com/docs/devtools/issues/) system.

## (1) Add new enum values

The three enums below should have consistent naming, and are all required to implement a new deprecation.

### (1a) [WebFeature](/third_party/blink/public/mojom/web_feature/web_feature.mojom)

This should be named `kFeatureName` and placed at the bottom of the file.
If you have an existing `WebFeature` that can be used instead.

### (1b) C++ [DeprecationIssueType](/third_party/blink/renderer/core/inspector/inspector_audits_issue.h)

This should be called `kFeatureName`, and the list should be kept alphabetical.

### (1c) Browser Protocol [DeprecationIssueType](/third_party/blink/public/devtools_protocol/browser_protocol.pdl)

This should be called `FeatureName`, and the list should be kept alphabetical.

## (2) Call `Deprecation::CountDeprecation`

This function requires a subclass of `ExecutionContext` and your new `WebFeature` to be passed in.
If you're already counting use with an existing `WebFeature`, you should swap `LocalDOMWindow::CountUse` with `ExecutionContext::CountDeprecation` as it will bump the counter for you.
If you only care about cross-site iframes, you can call `Deprecation::CountDeprecationCrossOriginIframe`.

## (3) Update [GetDeprecationInfo](/third_party/blink/renderer/core/frame/deprecation/deprecation.cc)

The new case statement should look like:
```
case WebFeature::kFeatureName:
return DeprecationInfo::WithTranslation(DeprecationIssueType::kFeatureName);
```

## (4) Update [AuditsIssue::ReportDeprecationIssue](/third_party/blink/renderer/core/inspector/inspector_audits_issue.cc)

The new case statement should look like:
```
case DeprecationIssueType::kFeatureName:
type = protocol::Audits::DeprecationIssueTypeEnum::FeatureName;
break;
```

## (5) Test

Please do not skip this step! Examples can be found in:
(/third_party/blink/web_tests/http/tests/inspector-protocol/issues/deprecation-issue.js)

## (6) Merge steps 1-5 in a `chromium/src` CL

Please tag deprecation-devtool-issues@chromium.org.

## (7) Manually roll dependencies from `chromium/src` to `devtools/devtools-frontend`

Check out `devtools/devtools-frontend` on the same dev machine where you have `chromium/src` checked out.
Check new branch out in `devtools/devtools-frontend`, and run (adjusting directories as needed):
```
./scripts/deps/roll_deps.py ~/chromium/src ~/devtools/devtools-frontend
npm run generate-protocol-resources
```
This pushes the change from (1c) into `devtools/devtools-frontend` so you can use it in (9).

## (8) Merge step 7 in a `devtools/devtools-frontend` CL

Please tag deprecation-devtool-issues@chromium.org as a reviewer.

## (9) Update [DeprecationIssue](/third_party/devtools-frontend/src/front_end/models/issues_manager/DeprecationIssue.ts)

You'll need to add a new string to `UIStrings` with your deprecation message, for example:
```
/**
*@description Additional information for translator on how and when this string is used
*/
featureName: 'This is the message shown to the web developer in the issue.',
```

You'll also need to handle the new case in `DeprecationIssue::getDescription`, for example:
```
case Protocol.Audits.DeprecationIssueType.FeatureName:
messageFunction = i18nLazyString(UIStrings.featureName);
break;
```

## (10) Test

Please do not skip this step! Examples can be found in:
(/third_party/devtools-frontend/src/test/e2e/issues/deprecation-issues_test.ts)

## (11) Merge steps 9 and 10 in a `devtools/devtools-frontend` CL

Please tag deprecation-devtool-issues@chromium.org as a reviewer.

## (12) Wait for automatic roll dependencies from `devtools/devtools-frontend` to `chromium/src`

This will be done by the [AutoRoller](https://autoroll.skia.org/r/devtools-frontend-chromium) within a few hours.

## (13) Build Chrome from tip-of-trunk

Verify everything is working as expected.
If something is broken and you can't figure out why, reach out to deprecation-devtool-issues@chromium.org.

0 comments on commit 3ff7ec8

Please sign in to comment.