npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@easy-editor/renderer-core

v1.0.2

Published

Renderer Core package for EasyEditor

Readme

@easy-editor/renderer-core

Renderer Core package for EasyEditor. This package provides the foundation for implementing framework-specific renderers (like React, Vue, etc.) in EasyEditor.

Package Structure

The renderer-core provides:

  • Type definitions for renderer implementations
  • Utility functions for schema processing
  • Core interfaces for component rendering
  • Data handling and transformation helpers

Features

  • Framework Agnostic: Core renderer interfaces that can be implemented for any UI framework
  • Schema Processing: Utilities for processing low-code schema structures
  • Component Model: Type definitions for component rendering and lifecycle management
  • Data Binding: Support for data expressions and bindings within schemas
  • DataSource Integration: Types for handling data sources in rendered components
  • Error Handling: Standardized error boundaries and component fallbacks

Core Interfaces

Renderer

The renderer is responsible for converting schema to component instances:

export interface RendererProps {
  // The schema representing the component tree
  schema: RootSchema | NodeSchema;

  // Component implementations mapped by name
  components: Record<string, ComponentType<any>>;

  // Rendering mode (design or live)
  designMode?: DesignMode;

  // Device information for responsive rendering
  device?: 'default' | 'pc' | 'mobile' | string;

  // Reference to the Simulator host
  __host?: Simulator;

  // ... additional properties
}

Component Types

The renderer-core defines several component types to handle different rendering scenarios:

// Regular component used in rendering
export interface GeneralComponent<P = any, S = any, SS = any> {
  // Component lifecycle methods
  componentDidMount?(): void;
  componentDidUpdate?(): void;
  componentWillUnmount?(): void;

  // Rendering method
  render(): any;

  // Component state and props
  props: P;
  state: S;
  // ... additional properties
}

// Component shown when a component is not found
export interface NotFoundComponentProps {
  componentName?: string;
  // ... additional properties
}

// Component shown when rendering fails
export interface FaultComponentProps {
  componentName?: string;
  error?: Error;
  // ... additional properties
}

Data Handling

The renderer-core provides utilities for handling data and expressions:

Expression Parsing

import { parseExpression } from '@easy-editor/renderer-core';

// Convert JSExpression objects into actual values
const result = parseExpression({
  type: 'JSExpression',
  value: '(function(){ return this.state.count + 1; })'
}, context);

Data Source Types

export interface DataSourceItem {
  id: string;
  isInit?: boolean | JSExpression;
  type?: string;
  options?: {
    uri: string | JSExpression;
    params?: JSONObject | JSExpression;
    method?: string | JSExpression;
    // ... additional options
  };
  dataHandler?: JSExpression;
}

export interface DataSource {
  list?: DataSourceItem[];
  dataHandler?: JSExpression;
}