* Make delays conditional on COMPILE_COMPAT, otherwise rely on keepalive fetch
* Add tests
* Fix webkit related test file-download feature tests issues
* Remove ternaries for scriptConfig in tests
* Make sure .compat scripts don't contain unreachable code blocks
* Test legacy .compat extension in a separate block
* Tests for tagged events
* Remove extraneous tests, add needed tests
* Add tests for v2 features overlap and outbound link clicks
* Add changelog, add current behaviour test for outbound links
* Remove mockRequest, unify API
* Fix coverage of legacy compat navigation, add back interactive event test
* chore: Bump tracker_script_version to 21
* Update specs
* Fix issues with _ variable
* Fix args
* Types and formatting cleanup
---------
Co-authored-by: apata <apata@users.noreply.github.com>
* Add CLI arguments to compile.js and logging
* Rename folder
* Extract compile code, es modules
* Add a progress bar
* Remove handlebars
* Update report-sizes
* Remove debug code
* inline
* More generous split
* Allow positional arguments for compiling
* Add watch option to compile
* Add compileFile logic
* Most tests run under playwright
* All tests runnable
* Update playwright, remove hack
Note that upgrading to latest failed due to a new test failure. This
might be due to a chrome update.
* Compile script on the fly for tests
* Minor refactor for compileAll
* es module for generate-variants.js
* Allow passing suffix to compilation script - this can be used to generate separate files for comparison
* Fix positionals
* Switch from 2 passes to 1 pass
Did some data analysis on this data:
- Compared to master, 1 pass increased brotli size by 0.7%, 2 passes 0.4%.
Given the change is insignificant enough, we can ignore it for now
The increase is likely due to order of operations in compilation and
some inlined functions getting lost.
* Move customEvents.js to plausible.js
* Clean up API
* Suffix default
* Rework variants.json, globals stored there
* Add more variants under test
* Distribute work across multiple worker threads
Compile time went on my machine from 60s -> 30s
* Fixup server
* Update canSkipCompile
* chore: Bump tracker_script_version to 7
* Update scripts
* Update node-version
* Experiment with adding a small delay to page
* Casing
* rename variable
* Update help text
* features -> compileIds, backport functionality from other branch
* improve tracker test util to handle custom props
* track pageleave props
* make test util more powerful
* also test with pageview-props extension
* add test for sending props on hash navigation
* simplify tracker logic around currentPageLeaveURL
* clarify the intent of a timeout by extracting a fn
* bugfix: stop sending pageleaves from ignored pages
+ fix the test to actually fail if this doesn't work.
* refactor: drop expectCustomEvent in favour of the new test util
* add test for pageleave props ingestion
* add query tests
* improve test util readability
* move util function to util module
* move playwright config file to tracker dir root
* update Playwright + add gitignores
* Playwright: enable reuseExistingServer (non-CI env)
* store tracker src copies to avoid re-compilation in dev env
* test pageleave on simple navigation
* fix test util fn
* rename local_test npm script
* make test util able to expect multiple requests
* test pageleaves in SPAs
* test pageleave with manual URL
* test pageleave not sent in manual when pageview not triggered
* extend util fn to refute event requests
* test pageleaves not sent in excluded hash pages
* store hashes instead of file copies to detect /tracker/src changes
* drop async
* speed up test suite
* bugfix: make sure to send pageleave with current URL
* another bugfix: avoid triggering pageleaves in SPAs unless listeningPageLeave is true
* revert behavioural change in manual extension
* test manual script extension