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

Add new tracker for React Native #1371

Open
wants to merge 12 commits into
base: wip/react-native
Choose a base branch
from

Conversation

matus-tomlein
Copy link
Contributor

@matus-tomlein matus-tomlein commented Nov 5, 2024

Adds the @snowplow/react-native-tracker package to the monorepo.

This aims to move the React Native tracker to instead of using the iOS and Android trackers as the base for the React Native tracker, to use the JavaScript tracker. The motivation for this is to:

  1. support Expo Go (managed workflow) and React Native for Web
  2. better support React Native new architecture without the interoperability layer
  3. make the tracker easier to maintain going forward (simplifies the project)
  4. be able to use JS tracker plugins (or some of them) in the RN tracker and vice versa

The package will continue with the @snowplow/react-native-tracker starting from version 4.1 (or later). We decided for this as opposed to introducing a new package to make it more clear long term that this package replaces the old RN tracker and avoid having two RN packages. We will need to skip v3 (RN tracker is now on v2) in order to sync with the JS tracker versions.

This PR implements the core of the tracker without additional features (such as session, lifecycle tracking) which will be introduced in follow up PRs. It tries to maintain the API from the RN tracker but for the createTracker method, this was not possible and I think it's better to follow the newTracker convention in the JS tracker. So the newTracker method signature is a breaking change.

I have deployed the package under the version 4.0.1-dev.1 and added a very simple example app in the examples repo using it: snowplow-incubator/snowplow-javascript-tracker-examples#60 (we'll improve it over time)

@matus-tomlein matus-tomlein changed the base branch from master to wip/react-native November 5, 2024 09:50
@matus-tomlein matus-tomlein marked this pull request as draft November 5, 2024 09:52
Copy link

bundlemon bot commented Nov 5, 2024

BundleMon

Files added (6)
Status Path Size Limits
trackers/javascript-tracker/dist/sp.js
+24.43KB 30KB / +10%
libraries/browser-tracker-core/dist/index.mod
ule.js
+23.44KB 25KB / +10%
libraries/tracker-core/dist/index.module.js
+19.4KB 20KB / +10%
trackers/browser-tracker/dist/index.umd.min.j
s
+17.32KB 20KB / +10%
trackers/javascript-tracker/dist/sp.lite.js
+17.27KB 20KB / +10%
trackers/browser-tracker/dist/index.module.js
+3.49KB 5KB / +10%

Total files change +105.35KB 0%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

@matus-tomlein matus-tomlein marked this pull request as ready for review November 7, 2024 10:36
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.

1 participant