Skip to content

Add preferred alternatives to problematic terminology #40348

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 6 commits into
base: main
Choose a base branch
from

Conversation

StarbirdTech
Copy link

@StarbirdTech StarbirdTech commented Jul 4, 2025

Summary

This PR addresses issue #30789 by adding functional alternatives to problematic terminology while maintaining full backward compatibility.

Changes

  • New function alias: computeInCoordinatingFrame() as alias for computeInMasterFrame()
  • New property aliases:
    • coordinator as alias for master
    • isCoordinator as alias for isMaster
  • Updated documentation to lead with new terminology while noting legacy compatibility
  • Added type definitions for new aliases
  • Comprehensive test coverage for all new alias functionality

Files Modified

  • 3p/3p.js: Added computeInCoordinatingFrame function
  • 3p/ampcontext-integration.js: Added coordinator and isCoordinator getters
  • build-system/externs/amp.extern.js: Added extern definitions
  • ads/README.md: Updated documentation to lead with new terminology
  • test/unit/test-3p.js: Added functional test
  • test/unit/3p/test-ampcontext-integration.js: Added alias tests

Backward Compatibility

All existing APIs continue to work unchanged. This provides a migration path to new terminology without breaking existing code.

Test Plan

  • Lint checks pass
  • Prettify checks pass
  • All existing functionality preserved
  • New aliases work correctly
  • 100% test coverage achieved for new alias functions
  • 4 focused tests for all new aliases

Fixes #30789

…ect#30789

- Add computeInCoordinatingFrame as alias for computeInMasterFrame
- Add coordinator property as alias for master
- Add isCoordinator property as alias for isMaster
- Update documentation to reference preferred alternatives
- Maintain backward compatibility with existing APIs
- Add test for computeInCoordinatingFrame function alias
- Add tests for coordinator and isCoordinator property aliases
- Add test for computeInCoordinatingFrame method delegation
- Use AMP-style focused, minimal test approach
- Achieve 100% coverage for new alias functionality
@StarbirdTech StarbirdTech force-pushed the fix-terminology-issue-30789 branch from c604b88 to a198e0c Compare July 4, 2025 16:10
@StarbirdTech StarbirdTech force-pushed the fix-terminology-issue-30789 branch from 35a3986 to d5dce51 Compare July 4, 2025 17:24
@erwinmombay
Copy link
Member

heya @StarbirdTech thanks for this!

is the change purely a terminology change? (just double checking)

@powerivq can you help review this

@@ -279,9 +279,13 @@ documentation with the new behaviors on user's consent choices. You can refer to

#### JS reuse across iframes

To allow ads to bundle HTTP requests across multiple ad units on the same page the object `window.context.master` will contain the window object of the iframe being elected master iframe for the current page. The `window.context.isMaster` property is `true` when the current frame is the master frame.
To allow ads to bundle HTTP requests across multiple ad units on the same page, use `window.context.coordinator` to access the coordinating iframe window object, and `window.context.isCoordinator` to check if the current frame is the coordinating frame.
Copy link
Member

Choose a reason for hiding this comment

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

@powerivq do you know if 3rd party code would need to make changes for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

They will. The best we can do is to offer an alias therefore.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces preferred aliases for “master” terminology across the 3p integration, externs, documentation, and tests, preserving full backward compatibility.

  • Adds computeInCoordinatingFrame as a functional alias to computeInMasterFrame
  • Introduces coordinator and isCoordinator getters in IntegrationAmpContext
  • Updates documentation, externs, and tests to lead with new terminology

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/unit/test-3p.js Added import and test for computeInCoordinatingFrame
test/unit/3p/test-ampcontext-integration.js Added tests for coordinator, isCoordinator, and alias method
build-system/externs/amp.extern.js Declared new externs context.coordinator and context.isCoordinator
ads/README.md Updated JS reuse docs to use new terminology
3p/ampcontext-integration.js Added coordinator/isCoordinator getters and alias method
3p/3p.js Added computeInCoordinatingFrame alias to computeInMasterFrame
Comments suppressed due to low confidence (2)

ads/README.md:282

  • [nitpick] This line is formatted as a paragraph while adjacent items are list entries; consider adding a leading dash or matching the list style for consistency.
To allow ads to bundle HTTP requests across multiple ad units on the same page, use `window.context.coordinator` to access the coordinating iframe window object, and `window.context.isCoordinator` to check if the current frame is the coordinating frame.

test/unit/test-3p.js:2

  • [nitpick] Align the indentation of imported names in the destructuring block for consistency with other imports.
  computeInCoordinatingFrame,

@StarbirdTech
Copy link
Author

is the change purely a terminology change? (just double checking)

Yes this should only be a terminology change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change window.context API to avoid problematic terms
3 participants