Skip to content

messaging: move docs to Markdown and never throw on calls to .notify #1817

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

Conversation

shakyShane
Copy link
Contributor

@shakyShane shakyShane commented Jul 11, 2025

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1201141132935289/task/1210768128803703?focus=true

Description

Small improvements towards https://app.asana.com/1/137249556945/project/1201141132935289/task/1210680503659356?focus=true

Screenshot 2025-07-11 at 08 02 21

Testing Steps

  • No functional changes, just moving docs around

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Copy link

netlify bot commented Jul 11, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 6d23b64
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/687156cfcccf590008ec38bf
😎 Deploy Preview https://deploy-preview-1817--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@shakyShane
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

github-actions bot commented Jul 11, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Jul 11, 2025

[Beta] Generated file diff

Time updated: Fri, 11 Jul 2025 18:25:38 GMT

Android
    - android/autofillPasswordImport.js
  • android/brokerProtection.js
  • android/contentScope.js
  • android/pages/duckplayer/dist/index.js

File has changed

Chrome-mv3
    - chrome-mv3/inject.js

File has changed

Firefox
    - firefox/inject.js

File has changed

Integration
    - integration/contentScope.js
  • integration/pages/duckplayer/dist/index.js
  • integration/pages/example/dist/index.js
  • integration/pages/history/dist/index.js
  • integration/pages/new-tab/dist/index.js
  • integration/pages/onboarding/dist/index.js
  • integration/pages/release-notes/dist/index.js
  • integration/pages/special-error/dist/index.js

File has changed

Windows
    - windows/contentScope.js
  • windows/pages/duckplayer/dist/index.js
  • windows/pages/history/dist/index.js
  • windows/pages/new-tab/dist/index.js
  • windows/pages/onboarding/dist/index.js
  • windows/pages/release-notes/dist/index.js
  • windows/pages/special-error/dist/index.js
  • windows/pages/special-error/index.html

File has changed

Apple
    - dist/contentScope.js
  • dist/contentScopeIsolated.js
  • dist/pages/duckplayer/dist/index.js
  • dist/pages/duckplayer/index.html
  • dist/pages/history/dist/index.js
  • dist/pages/new-tab/dist/index.js
  • dist/pages/onboarding/dist/index.js
  • dist/pages/release-notes/dist/index.js
  • dist/pages/special-error/dist/index.js
  • dist/pages/special-error/index.html

File has changed

@shakyShane shakyShane marked this pull request as ready for review July 11, 2025 07:23
@shakyShane shakyShane requested a review from a team as a code owner July 11, 2025 07:23
@shakyShane shakyShane requested a review from Copilot July 11, 2025 08:53
Copy link

@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 extracts inline documentation into standalone Markdown files for better maintainability, updates the Typedoc configuration to include the new docs, and ensures .notify() calls never throw by wrapping them in a try/catch (with a corresponding unit test).

  • Move native.js inline docs into messaging/docs/ Markdown files (messaging.md, implementation-guide.md, examples.md)
  • Update typedoc.js to include the top‐level messaging/docs/messaging.md
  • Wrap transport.notify in a silent try/catch and add a unit test to verify no exception is thrown

Reviewed Changes

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

Show a summary per file
File Description
typedoc.js Includes messaging/docs/messaging.md in the Typedoc config
messaging/native.js Remove large inline doc comment, replace with module link
messaging/index.js Wrap transport.notify in try/catch and update JSDoc comments
messaging/docs/messaging.md New high-level Markdown overview for Messaging API
messaging/docs/implementation-guide.md New platform implementation guide Markdown
messaging/docs/examples.md New example payloads Markdown file
injected/unit-test/messaging.js Add unit test ensuring .notify() doesn’t throw on errors
Comments suppressed due to low confidence (1)

typedoc.js:10

  • The Typedoc include pattern currently only adds messaging/docs/messaging.md, but the implementation-guide.md and examples.md files won't be processed. Consider changing it to a glob like messaging/docs/*.md or adding individual entries for those Markdown files so all docs are published.
        'messaging/docs/messaging.md',

Copy link
Contributor

@jonathanKingston jonathanKingston left a comment

Choose a reason for hiding this comment

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

Do we need to validate all consumers of notify don't expect the throw? I know for bridge you were using it as a proxy for lack of support right?

@jonathanKingston
Copy link
Contributor

@cursor anything to add?

@jonathanKingston
Copy link
Contributor

@cursor anything to add?

Leave me unread then. 😢

@shakyShane
Copy link
Contributor Author

Do we need to validate all consumers of notify don't expect the throw? I know for bridge you were using it as a proxy for lack of support right?

No, the bridge only delegates to the transports regardless.

@shakyShane shakyShane merged commit ad3114c into main Jul 14, 2025
19 of 20 checks passed
@shakyShane shakyShane deleted the 07-11-messaging_move_docs_to_markdown_and_never_throw_on_calls_to_.notify branch July 14, 2025 10:45
mallexxx pushed a commit that referenced this pull request Jul 17, 2025
…1817)

* messaging: move docs to Markdown and never throw on calls to .notify

* add development debugging so that generic implementation errors are not lost
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.

2 participants