Unify DynamicContext callback parameters across link click, button click and form tracking plugins in v5 release

Open
#1,390 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
frontend, web-dev

Research direction

Start with the linked PR #1389 review and issue #1368, then compare the DynamicContext callback signatures described for the Button, Link, and Form plugins. Define the v5 object-parameter interface and its event data requirements across those plugins; done means the three plugin APIs are consistently specified for the breaking change.

Written by the indexing model from the issue text.

Description

Suggested in https://github.com/snowplow/snowplow-javascript-tracker/pull/1389#pullrequestreview-2453061584:

It's unfortunate we couldn't fit this into v4 as a breaking change, the resulting API inconsistency with the other plugins will be a bit awkward to resolve now.

Plugin Context Arg 1 Context Arg 2 Context Arg 3
Button Event Payload - (Element in this PR) -
Link Element - -
Form (Change/Focus) Element Element Type Element Value
Form (Submit) Element ElementData[] -

It might be worth planning for v5 to unify plugins onto a single object param for dynamic contexts so we can be a bit looser with the interface. For Link and Button at least, getting the actual MouseEvent/PointerEvent for information on the type of click, modifier keys, coordinates, pressure used, etc could be useful in some use cases (as suggested in #1368) so would be nice to add in at some point.

Originally posted by @jethron in https://github.com/snowplow/snowplow-javascript-tracker/pull/1389#pullrequestreview-2453061584

Dominant language
TypeScript
Stars
590
Forks
232
Avg merge
2h 22m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from snowplow/snowplow-javascript-tracker

All issues in snowplow/snowplow-javascript-tracker

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.