New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@oribuild/client

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oribuild/client

0.0.0-pre-alpha.15
latest
Source
npm
Version published
Maintainers
2
Created
Source

@oribuild/client

Overview

Packaged designed to be used to expose runtime information from the client to ori's runtime, through its web-server API. Primary type of information intended to be exposed is real-user metrics, as it's an important part of the development experience. More so because ori is designed to be used on big apps, that usually means an unusually high number of source code to be bundled. This coupled to different build strategy approaches, which can mean different chunking strategies and, hence, the amount of scripts to be downloaded and their sizes can vary wildly. Which, in turn, impacts how fast the browser can download, parse and execute scripts.

Design and dependencies

This project depends on the existence of a Symbol.for('oribuild') property on globalThis, to read metadata about ori runtime. This object is exposed by ori runtime, and is injected on all built entry points. It is supposed to expose necessary information to the client so it can primarily a) communicate to the server and b) know which APIs are available, proxied by this package's version.

The reason for being a separate project, instead of also injecting this project's code into the build entry points is, primarily, to offer a flexible, decoupled, avenue to log these metrics. As a sub-product, it also allows for a simple implementation on the injection mechanism, as it only needs to expose a simple object.

Public API

logUserMetric(opts: RealUserMetricOpts): Promise<boolean>

Intended to log real-user metrics to be used for a more complete picture of builder (and build-time) performance analysis.

So far, the following metrics are supported: TTI, FID, PLT and TTFB. The reasoning for choosing this metrics is that we are concerned with the time it takes for an app to be in a usable state, as that is the biggest impact a builder can have on the development experience.

At this time, it is up for consumers to implement the actual measurement of these metrics. This client package (so far) only exposes a way to log them to ori's analytics server.

logRuntimeError(opts: RuntimeErrorOpts): Promise<boolean>

Intended to log runtime errors that happen on the client side for both a) logging purposes and b) to be able to allow for ori's runtime to potentially recover from them.

API is exposed on api.ts.

Distribution

As mentioned on #design-and-dependencies, this package relies on the metadata's version to infer which APIs are available. This means that, for now, package versions are supposed to be, so far, manually.

yarn version <minor|major|patch|prerelease>

FAQs

Package last updated on 20 Aug 2023

Did you know?

Socket

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.

Install

Related posts