Skip to content
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

Only export core types from messaging #1188

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shakyShane
Copy link
Contributor

@shakyShane shakyShane commented Nov 1, 2024

Asana Task/Github Issue: https://app.asana.com/0/1201614831475344/1208567543316316/f

Description

Alter the messaging API to prevent having to import all implementations (and them ending up in resulting bundles)

Note

This doesn't improve special pages just yet, but it is a big improvement for the injected side

Testing Steps

  • If all the automated tests pass, we have a very high level of confidence.

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

@shakyShane
Copy link
Contributor Author

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

Join @shakyShane and the rest of your teammates on Graphite Graphite

Copy link

netlify bot commented Nov 1, 2024

Deploy Preview for content-scope-scripts failed.

Name Link
🔨 Latest commit 9c0d928
🔍 Latest deploy log https://app.netlify.com/sites/content-scope-scripts/deploys/6726076eb01dfc0008ec3ee0

Copy link

github-actions bot commented Nov 1, 2024

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 Nov 1, 2024

[Beta] Generated file diff

Time updated: Sat, 02 Nov 2024 11:06:20 GMT

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

File has changed

Chrome
    - chrome/inject.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/js/index.js
  • integration/pages/example/js/index.js
  • integration/pages/new-tab/js/index.js
  • integration/pages/onboarding/js/index.js
  • integration/pages/release-notes/js/index.js
  • integration/pages/special-error/js/index.js

File has changed

Windows
    - windows/contentScope.js
  • windows/pages/duckplayer/js/index.js
  • windows/pages/new-tab/js/index.js
  • windows/pages/onboarding/js/index.js

File has changed

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

File has changed

@shakyShane shakyShane marked this pull request as ready for review November 1, 2024 19:15
@@ -82,7 +81,7 @@ describe('Android', () => {
featureName,
env: 'development'
})
const messaging = new Messaging(messageContextA, config)
const messaging = config.intoMessaging(messageContextA)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

By reversing the dependency here, it prevents the Messaging constructor from having to know about every transport

*/
export class Messaging {
/**
* @param {MessagingContext} messagingContext
* @param {MessagingConfig} config
* @param {MessagingTransport} transport
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the significant change here, is that we directly take a transport now, preventing the core library needing to know about them all ahead of time

@shakyShane shakyShane force-pushed the 11-01-only_export_core_types_from_messaging branch from 366aeb5 to 9c0d928 Compare November 2, 2024 11:05
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.

1 participant