CodeSampleX

Sample

react-is 19.2.8: Profiler

Verified sample for npm react-is 19.2.8: Profiler. The contract ran on node 22 · linux debian/x64 · docker and passed: react-is exports Profiler matching…

sha256:e40aea54588f008e7c0ce6c19e962010c6a01c524b2e06bffc8937e59aa1cd86

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
1
Signing keys that built it
1
Declared environment linux 24 · ubuntu · glibc 2.39 x64 npm

Verification-run environments

Environment Contract Stages Run
node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2…
2026-09-06

Case

HOW
Goal
verify react-is.Profiler in pkg:npm/react-is@19.2.8
Packages
Symbols
  • react-is.Profiler
Created
2026-09-06T06:23:19Z

Contract

  1. react-is exports Profiler matching Symbol.for('react.profiler')
  2. isValidElementType identifies Profiler as a valid React element type
  3. isProfiler detects valid React 19 Profiler elements
  4. isProfiler returns false for Profiler symbol itself, non-profiler elements, and primitives
  5. typeOf returns Profiler symbol for valid profiler elements and undefined for non-elements

Files

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • src/index.js
  • test/contract.mjs

Download the source artifact (tar.gz)

Source

PROMPT.md
Clean-room public code sample — generation instructions

Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.

A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.

Goal: verify react-is.Profiler in pkg:npm/react-is@19.2.8
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/react-is@19.2.8
Demonstrate these symbols/APIs:
  - react-is.Profiler

Rules:
  - One focused purpose; the smallest project that proves the goal.
  - Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
  - Pin every dependency with a lockfile so resolution is reproducible.
  - No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
  - No personal names, emails, company names, or project identifiers of any kind.
  - No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
  - Keep it under 200 files and 256KB packed.
csx.json
{"case":{"caseId":"case:sha256:d2cc11d427fbba4d7b6e0eb8fdf9415e29e9d2e53b7b905bfacded8f68717480","contract":["react-is exports Profiler matching Symbol.for('react.profiler')","isValidElementType identifies Profiler as a valid React element type","isProfiler detects valid React 19 Profiler elements","isProfiler returns false for Profiler symbol itself, non-profiler elements, and primitives","typeOf returns Profiler symbol for valid profiler elements and undefined for non-elements"],"goal":"verify react-is.Profiler in pkg:npm/react-is@19.2.8","kind":"HOW","packages":["pkg:npm/react-is@19.2.8"],"schemaVersion":1,"symbols":["react-is.Profiler"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/react-is@19.2.8"],"schemaVersion":1,"subject":"pkg:npm/react-is@19.2.8","symbols":["react-is.Profiler"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-react-is-profiler",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-react-is-profiler",
      "version": "1.0.0",
      "dependencies": {
        "react-is": "19.2.8"
      }
    },
    "node_modules/react-is": {
      "version": "19.2.8",
      "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.8.tgz",
      "integrity": "sha512-s5un28nYxKJw5gvUHyW5PCC28CvBqLu9r3cWgzHT4Vo/5fqqkFcdRYsGcKf50WMPpjjFZS5d76fn3YCo2njKwQ==",
      "license": "MIT"
    }
  }
}
package.json
{
  "name": "sample-react-is-profiler",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification of react-is.Profiler in React 19",
  "type": "module",
  "main": "src/index.js",
  "dependencies": {
    "react-is": "19.2.8"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify react-is.Profiler in pkg:npm/react-is@19.2.8",
  "kind": "HOW",
  "packages": [
    "pkg:npm/react-is@19.2.8"
  ],
  "symbols": [
    "react-is.Profiler"
  ]
}
src/index.js
import {
  Profiler,
  isProfiler,
  typeOf,
  isValidElementType,
  Element,
} from 'react-is';

export { Profiler, Element };

/**
 * Creates a React 19 element representation.
 *
 * @param {*} type - The element type.
 * @param {Object} [props={}] - Element properties.
 * @returns {Object} React element object.
 */
export function createElement(type, props = {}) {
  return {
    $$typeof: Element || Symbol.for('react.transitional.element'),
    type,
    props,
    key: null,
    ref: null,
  };
}

/**
 * Creates a React 19 Profiler element representation.
 *
 * @param {string} id - Identifier for the profiler tree.
 * @param {Function} [onRender] - Callback function for commit metrics.
 * @param {*} [children] - Children to include in props.
 * @returns {Object} React Profiler element object.
 */
export function createProfilerElement(id = 'app-profiler', onRender = () => {}, children) {
  const props = { id, onRender };
  if (children !== undefined) {
    props.children = children;
  }
  return createElement(Profiler, props);
}

/**
 * Checks whether a given object is a React Profiler element.
 *
 * @param {*} value - The value to test.
 * @returns {boolean} True if the value is a Profiler element.
 */
export function checkIsProfiler(value) {
  return isProfiler(value);
}

/**
 * Checks whether a given type is a valid React element type.
 *
 * @param {*} type - The type to test.
 * @returns {boolean} True if the type is valid.
 */
export function checkIsValidElementType(type) {
  return isValidElementType(type);
}

/**
 * Inspects the React type of a given value.
 *
 * @param {*} value - The value to inspect.
 * @returns {*|undefined} Type symbol or undefined.
 */
export function inspectTypeOf(value) {
  return typeOf(value);
}
test/contract.mjs
import assert from 'node:assert/strict';
import {
  Profiler,
  Element,
  createElement,
  createProfilerElement,
  checkIsProfiler,
  checkIsValidElementType,
  inspectTypeOf,
} from '../src/index.js';
import reactIs from 'react-is';

// Contract 1: react-is exports Profiler matching Symbol.for('react.profiler')
assert.equal(typeof Profiler, 'symbol', 'Profiler must be a symbol');
assert.equal(Profiler, Symbol.for('react.profiler'), 'Profiler must match Symbol.for("react.profiler")');
assert.equal(reactIs.Profiler, Profiler, 'Default import Profiler must match named import Profiler');

// Contract 2: isValidElementType identifies Profiler as a valid React element type
assert.equal(checkIsValidElementType(Profiler), true, 'Profiler must be recognized as a valid element type');
assert.equal(reactIs.isValidElementType(Profiler), true, 'react-is.isValidElementType must return true for Profiler');
assert.equal(checkIsValidElementType('div'), true, 'String tag must be a valid element type');
assert.equal(checkIsValidElementType(() => null), true, 'Function component must be a valid element type');
assert.equal(checkIsValidElementType(123), false, 'Number must not be a valid element type');
assert.equal(checkIsValidElementType(null), false, 'null must not be a valid element type');
assert.equal(checkIsValidElementType(undefined), false, 'undefined must not be a valid element type');

// Contract 3: isProfiler detects valid React 19 Profiler elements
const profilerWithChildren = createProfilerElement('main-tree', () => {}, ['child1', 'child2']);
assert.equal(checkIsProfiler(profilerWithChildren), true, 'Profiler element with children must be detected by checkIsProfiler');
assert.equal(reactIs.isProfiler(profilerWithChildren), true, 'Profiler element with children must be detected by reactIs.isProfiler');

const emptyProfiler = createProfilerElement('empty-tree');
assert.equal(checkIsProfiler(emptyProfiler), true, 'Empty Profiler element must be detected by checkIsProfiler');
assert.equal(reactIs.isProfiler(emptyProfiler), true, 'Empty Profiler element must be detected by reactIs.isProfiler');

// Contract 4: isProfiler returns false for Profiler symbol itself, non-profiler elements, and primitives
assert.equal(checkIsProfiler(Profiler), false, 'Profiler symbol itself is not an element instance');
assert.equal(reactIs.isProfiler(Profiler), false, 'Profiler symbol itself must return false from isProfiler');

const divElement = createElement('div', { id: 'root' });
assert.equal(checkIsProfiler(divElement), false, 'Plain div element must not be identified as a Profiler');
assert.equal(reactIs.isProfiler(divElement), false, 'Plain div element must return false from isProfiler');

const suspenseElement = createElement(Symbol.for('react.suspense'));
assert.equal(checkIsProfiler(suspenseElement), false, 'Suspense element must not be identified as a Profiler');

const legacyProfiler = {
  $$typeof: Symbol.for('react.element'),
  type: Profiler,
  props: { id: 'legacy' },
  key: null,
  ref: null,
};
assert.equal(checkIsProfiler(legacyProfiler), false, 'Legacy React element $$typeof is not recognized by React 19 react-is');

assert.equal(checkIsProfiler(null), false, 'null must return false');
assert.equal(checkIsProfiler(undefined), false, 'undefined must return false');
assert.equal(checkIsProfiler({}), false, 'Plain object must return false');
assert.equal(checkIsProfiler('react.profiler'), false, 'String must return false');
assert.equal(checkIsProfiler(42), false, 'Number must return false');

// Contract 5: typeOf returns Profiler symbol for valid profiler elements and undefined for non-elements
assert.equal(inspectTypeOf(profilerWithChildren), Profiler, 'inspectTypeOf must return Profiler symbol for profiler element');
assert.equal(reactIs.typeOf(profilerWithChildren), Profiler, 'reactIs.typeOf must return Profiler symbol for profiler element');
assert.equal(inspectTypeOf(emptyProfiler), Profiler, 'inspectTypeOf must return Profiler symbol for empty profiler element');

assert.equal(inspectTypeOf(divElement), Element, 'inspectTypeOf returns Element symbol for plain element');
assert.equal(inspectTypeOf(suspenseElement), Symbol.for('react.suspense'), 'inspectTypeOf returns Suspense symbol');
assert.equal(inspectTypeOf(Profiler), undefined, 'inspectTypeOf returns undefined for Profiler symbol');
assert.equal(inspectTypeOf(null), undefined, 'inspectTypeOf returns undefined for null');
assert.equal(inspectTypeOf(undefined), undefined, 'inspectTypeOf returns undefined for undefined');
assert.equal(inspectTypeOf({}), undefined, 'inspectTypeOf returns undefined for plain object');
assert.equal(inspectTypeOf(legacyProfiler), undefined, 'inspectTypeOf returns undefined for legacy element');

console.log('All react-is.Profiler contract assertions passed.');

Origin Seeder

anonymous