cerebral-url-scheme-compiler

raw JSON →
0.5.3 verified Fri May 01 auth: no javascript deprecated

A URL scheme compiler for the Cerebral state management framework (deprecated). Version 0.5.3 is the last release. It compiles path URLs into efficient getter and setter functions used by Cerebral actions. The package is deprecated due to Cerebral's evolution to v2+, which uses a different state access pattern. No longer maintained; alternatives include direct state access via Cerebral's props or other state libraries.

error Cannot find module 'cerebral-url-scheme-compiler/get'
cause Subpath import requires Node.js >=12 or specific bundler configuration.
fix
Ensure your environment supports package exports or use a bundler that resolves subpath imports.
error TypeError: getCompiler is not a function
cause Incorrect import: importing from root package instead of subpath.
fix
Use import getCompiler from 'cerebral-url-scheme-compiler/get' instead of from 'cerebral-url-scheme-compiler'.
deprecated Package is deprecated and no longer maintained. Use with Cerebral v2+ is not supported.
fix Migrate to Cerebral v2+ which uses a different state access pattern via props or template literals.
breaking The package relies on Cerebral's internal state structure which changed significantly in v2.
fix Do not use with Cerebral v2+; consider alternatives like direct object path access.
npm install cerebral-url-scheme-compiler
yarn add cerebral-url-scheme-compiler
pnpm add cerebral-url-scheme-compiler

Shows how to compile a URL path into a getter function and use it with a Cerebral controller.

import getCompiler from 'cerebral-url-scheme-compiler/get';
import { Controller, Module } from 'cerebral';
const app = Module({});
const controller = Controller(app);
const getValue = getCompiler('app.items.0.title');
const result = getValue({ state: controller.getState });