![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@times-components/tracking
Advanced tools
Tracking is a collection of Higher-Order-Components (HOCs) that extract and report analytics of a component. All HOCs consume a component and an object describing how to create the analytics event.
The returned component expects an analyticsStream
to be available in React
context or to be passed directly to the component via props. Every tracking HOC
passes it's analyticsStream
to it's descendants via React context.
n.b. while there is a "tracking context" that uses "React context", they are not the same thing. The "tracking context" can be thought of as a "decoration boundary" between logical business layers which are useful for reporting.
How to implement tracking: +------------------------------------------+ | | | Tracking context HOC | | | | +----------------------------------+ | | | | | | | Tracking HOC - what events | | | | should be sent? | | | | +-------------------------+ | | | | | Component | | | | | | | | | | | +-------------------------+ | | | | | | | +----------------------------------+ | | | +------------------------------------------+ Compose for this architecture: | | | v +-------------------------------------------------------------------+ | | | Last tracking context - send to a reporter (such as Tealium) | | | | +-------------------------------------------------------------+ | | | Tracking context - edition information added | | | | | | | | +-------------------------------------------------------+ | | | | | | | | | | | Component - knows nothing about tracking which | | | | | | is passed via context | | | | | | +------------------------------------------+ | | | | | | | Tracking context - section information | | | | | | | | added | | | | | | | | +---------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Component with | | | | | | | | | | tracking HOC sends click | | | | | | | | | | events | | | | | | | | | +---------------------------+ | | | | | | | | | | | | | | | | | | | | | | | +------------------------------------------+ | | | | | +-------------------------------------------------------+ | | | +-------------------------------------------------------------+ | +-------------------------------------------------------------------+
The analyticsStream
prop is expected to be a function that consumes an event
object.
To test whether your component propagates the correct events, pass jest.fn()
as the analyticsStream
and test if your mock received the expected events.
Mind that you need to mock the Date
and setTimeout
to make your tests
reproducible.
const events = jest.fn();
renderer.create(<ComponentWithTracking analyticsStream={events} />);
expect(events.mock.calls).toMatchObject(...);
Please read CONTRIBUTING.md before contributing to this package
Please see our main README.md to get the project running locally
The code can be formatted and linted in accordance with the agreed standards.
yarn fmt
yarn lint
This package uses yarn (latest) to run unit tests on each platform with jest.
yarn test:web
Visit the official storybook to see our available tracking templates.
FAQs
Tracking
The npm package @times-components/tracking receives a total of 0 weekly downloads. As such, @times-components/tracking popularity was classified as not popular.
We found that @times-components/tracking demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.