-
Notifications
You must be signed in to change notification settings - Fork 22
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
#7649: introduce platform protocol to define clear platform boundary and decouple bricks from messenger/webext APIs #7650
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7650 +/- ##
==========================================
- Coverage 72.77% 72.52% -0.25%
==========================================
Files 1251 1259 +8
Lines 39018 39262 +244
Branches 7319 7326 +7
==========================================
+ Hits 28396 28476 +80
- Misses 10622 10786 +164 ☔ View full report in Codecov by Sentry. |
…would crash browser
@grahamlangford I think this is good for another review |
Created here: #7680 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still having issues with the tooltipController test.
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
What does this PR do?
PlatformProtocol
made available to bricks to call cross-platform affordances. Motivation:BrickOptions
getRequiredCapabilities
method to theBrick
interface to support static analysis of platform affordancescontentScriptPlatform
. The next platform will most likely bewebPagePlatform
to support https://github.com/pixiebrix/pixiebrix-app/pull/4738modalDom
,popoverDom
,ephemeralForm
,ephemeralPanel
formController
,panelController
, andstateController
to the platform folder, because their logic doesn't depend on content-script affordancesRemaining Work
Reviewer Tips
@/platform
foldercontentScriptPlatform
implementation - that's also the platform passed to Jest by default (seeinjectRegistries
test utility)@/contentScript
folder files:ephemeralForm
,ephemeralPanel
,modalDom
,popoverDom
BrickOptions.platform
. I apologize in advance for the number of files touchedDiscussion
document
orwindow
object on the platform object to enforce access via the protocol. Even in a FaaS/headless environment, we'd probably make jsdom available. (Although jsdom doesn't have access to layout)engineRenderer
ActivateTabEffect
and some others I just kept the background messenger call for nowDemo
Future Work
@/contentScript
directory in@/bricks
to force labeling abstraction leakage (including/api
)@/background
directory in@/bricks
to force labeling abstraction leakage (including/api
)@/bricks
an error to force labeling abstraction leakage@/utils/notify
in theruntime
folder to force labeling abstraction leakageChecklist
src/tsconfig.strictNullChecks.json
(if possible)