Skip to content
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

feat: Soft Navigations trial #808

Merged
merged 114 commits into from
Mar 13, 2024
Merged

feat: Soft Navigations trial #808

merged 114 commits into from
Mar 13, 2024

Conversation

cwli24
Copy link
Contributor

@cwli24 cwli24 commented Nov 9, 2023

Introducing a lighter and simplified version of the existing spa feature that tracks soft navigations. This new feature still sends BrowserInteraction events, but the duration and finishing of those interactions have been redefined. As a replacement, it ought to reduce complexity and integration issues around the existing spa and exhibit better and faster performance.

Overview

Soft navigations feature is disabled unless the soft-nav feature flag is passed into the init configuration, in which case soft nav will replace the old spa on the page. This feature captures "interactions" based on the following sequences in exact chronological order:

  1. click, keydown, or submit event on the page occurs
    a. an interaction can also be started through the newrelic.interaction() api
  2. the location (url) of the page is altered
  3. there's a dom change noticed by MutationObserver

No ensuing single or chained callbacks, network requests, async timers, etc. are tracked, and they do not affect the length of the interaction, unlike the old spa method. The createTracer spa api will have no effect on soft nav, though the other spa apis remain the same.

Related Issue(s)

Building on #626
Angler: https://source.datanerd.us/agents/angler/pull/529

Testing

Jest & wdio tests for feature added based on this google doc

Copy link

github-actions bot commented Jan 24, 2024

Static Badge

Last ran on March 12, 2024 14:22:41 CDT
Checking merge of (3dac1f7) into main (dfdbaab)

@cwli24 cwli24 merged commit 7fcb627 into main Mar 13, 2024
17 checks passed
@cwli24 cwli24 deleted the basic-spa-feat branch March 13, 2024 16:54
@EduardDopler
Copy link

Any plans to pull only either the old or the new implementation into the browser? Currently, both are part of the spa build. Hence the significant increase in size.

@patrickhousley
Copy link
Contributor

Any plans to pull only either the old or the new implementation into the browser? Currently, both are part of the spa build. Hence the significant increase in size.

It is not possible in our current deployment mechanics. Our plans are to eventually remove the old SPA feature completely which will reduce the bundle size. In the mean time, the NPM package allows customers to build their own customized agent with the features they care about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants