Refactor common Playwright wrappers as services - #31
Merged
Conversation
commit: |
fiws
force-pushed
the
fix-common-wrapper-services
branch
2 times, most recently
from
September 3, 2026 08:07
0a3ff0f to
d757915
Compare
fiws
force-pushed
the
fix-common-wrapper-services
branch
from
September 3, 2026 08:09
d757915 to
5b087bb
Compare
StefanWerW
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Data.TaggedClasswrappers withContext.Servicevalues and named constructorsRequest.failure,Request.postData, andRequest.postDataBufferRequest.postDataJSONparsing withEffect.tryCloses #29
Closes #30
Verification
pnpm test src/common.test.tspnpm test src/playwright.test.tspnpm type-checkpnpm buildNote
Medium Risk
Breaking public API for six common event/network wrappers affects all consumers; Request wrapper changes alter error and binding semantics on widely used network APIs.
Overview
Breaking (0.8.0):
Request,Response,Worker,Dialog,FileChooser, andDownloadare no longerData.TaggedClassmodels. They are nowContext.Serviceinterfaces withmakeRequest,makeResponse,makeWorker,makeDialog,makeFileChooser, andmakeDownloadexported onPlaywright. Wrapped values no longer have_tag; use the named constructors instead ofPlaywright.Request.make(...).Event mappings on
PageandBrowserContextand the publicplaywright-apiexports were updated to the new constructors. Agent docs andCHANGELOGdescribe the Effect 4 / service pattern.Request behavior fixes:
postData,postDataBuffer, andfailurecall the native methods with correctthisbinding.postDataJSONis wrapped inEffect.tryand maps nullish results toOption. Tests cover these cases and assert services viaEffect.provideServiceinstead of_tag.Reviewed by Cursor Bugbot for commit 5b087bb. Bugbot is set up for automated code reviews on this repo. Configure here.