![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.
@locker/instrumentation
Advanced tools
The instrumentation package provides utility functions, also known as beacons, to facilitate instrumenting Locker vNext code without having to bind the entire codebase to an external interface.
There are 3 beacons provided, 1 for instrumenting errors, 1 for generic logging and 1 for metrics (activity).
import { LockerInstrumentation } from '@locker/instrumentation';
const { activityBeacon, errorBeacon, logBeacon } = new LockerInstrumentation();
The beacons can now be used to instrument code in Locker.
Due to possible restrictions on the instrumentation service, the high volume of method calls and privacy considerations in sandboxed code, Locker cannot instrument serialized method parameters or method return values. As a consequence, the beacons will invoke the instrumentation client using specific information.
const { activityBeacon } = new LockerInstrumentation(myService);
// instrumented activity is started for current sandboxKey
const myActivity = activityBeacon(sandboxKey, 'fooActivity');
myActivity.start();
// or use chaining
// const myActivity = activityBeacon(sandboxKey, 'fooActivity').start();
foo();
// we stop the activity after last instrumeted call
myActivity.stop();
const { logBeacon } = new LockerInstrumentation(myService);
const foo: Array = bar();
logBeacon(sandboxKey, `bar method returned ${foo.length} results.`);
const { errorBeacon } = new LockerInstrumentation(myService);
try {
foo();
} catch (e) {
errorBeacon(sandboxKey, e);
throw e;
}
To plug in an external service in Locker vNext the following steps are required:
class MyInstrumentation extends LockerInstrumentation {
activityBeacon(sandboxKey, nameOrDescription) {
return new Activity(sandboxKey, nameOrDescription, startCallback, stopCallback);
}
errorBeacon(sandboxKey, e) {
errorCallback(sandboxKey, e.message, e.type, e.stack);
}
logBeacon(sandboxKey, message) {
logCallback(sandboxKey, message);
}
}
evaluateInSandbox
or evaluateInCoreSandbox
and provide MyInstrumentation
as an argumentconst instrumentation = new MyInstrumentation();
evaluateInSandbox(key, code, null, null, instrumentation);
FAQs
Lightning Web Security instrumentation utilities
The npm package @locker/instrumentation receives a total of 139 weekly downloads. As such, @locker/instrumentation popularity was classified as not popular.
We found that @locker/instrumentation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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.