Revealon Bid Adapter: initial release#14618
Conversation
|
Whoa there partner! This project is migrating to typescript. Consider changing the new JS files to TS, with well-defined types for what interacts with the prebid public API (for example: bid params and configuration). Thanks!
|
Pull Request Test Coverage Report for Build 23438876026Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
Whoa there partner! This project is migrating to typescript. Consider changing the new JS files to TS, with well-defined types for what interacts with the prebid public API (for example: bid params and configuration). Thanks!
|
| getUserSyncs | ||
| } | ||
|
|
||
| registerBidder(spec); |
There was a problem hiding this comment.
@codex what would this adapter need to do to change this file typescript?
There was a problem hiding this comment.
Great question. For this PR comment, the reviewer is basically asking for a JS → TS migration of modules/revealonBidAdapter.js, with explicit typing for the adapter’s public interface (especially bid params/config).
What the adapter would need to do
At a minimum, it should follow the same TypeScript pattern used by existing TS adapters in this repo:
-
Rename the file to
.tsmodules/revealonBidAdapter.js→modules/revealonBidAdapter.ts(and keep same module registration behavior).- Existing TS adapters end with
registerBidder(spec).
-
Type the Prebid adapter contract
- Use typed imports like
BidderSpec,AdapterRequest,BidRequest,ClientBidderRequest,ORTBRequestwhere relevant. - Define the spec as
BidderSpec<typeof BIDDER_CODE>.
- Use typed imports like
-
Define and enforce bidder params type
- Add a concrete
RevealonBidParamstype for params used by this bidder, including required/optional semantics (many adapters use a helper likeRequireAtLeastOne). - Wire params into Prebid’s global bidder param typing via module augmentation:
(pattern used across TS adapters).
declare module '../src/adUnits' { interface BidderParams { [BIDDER_CODE]: RevealonBidParams; } }
- Add a concrete
-
Type key methods
isBidRequestValid(bid: BidRequest<typeof BIDDER_CODE>): booleanbuildRequests(...): AdapterRequest- Type ORTB/intermediate request objects where applicable.
-
Keep logic, add type safety
- The migration is expected to preserve behavior while adding strongly typed public touchpoints (
params, request config, response handling hooks). - Reviewer’s note explicitly calls out “well-defined types” for public API interactions, so params/config typing is the must-have.
- The migration is expected to preserve behavior while adding strongly typed public touchpoints (
Practical checklist for the author
- Convert file extension to
.ts - Add
RevealonBidParamstype - Add
declare module '../src/adUnits'mapping forrevealon - Add
BidRequest<typeof BIDDER_CODE>/ClientBidderRequest<typeof BIDDER_CODE>/AdapterRequestannotations - Ensure
specis typedBidderSpec<typeof BIDDER_CODE> - Run lint + targeted adapter test per repo guidelines
Commands I used to validate patterns
rg --files -g 'AGENTS.md'rg --files modules | rg 'BidAdapter\\.ts$|\\.ts$' | head -n 20sed -n '1,240p' modules/revnewBidAdapter.tssed -n '1,220p' modules/adgridBidAdapter.tsnl -ba modules/revnewBidAdapter.ts | sed -n '1,220p'nl -ba modules/adgridBidAdapter.ts | sed -n '1,220p'
I did not make code changes in this workspace, so no commit/PR was created.
There was a problem hiding this comment.
Hi, I've addressed all the review feedback. Could someone please take another look? Thanks!
Type of change
Description of change
Other information
Docs RP: prebid/prebid.github.io#6493