Macro Code gen

Explain macro expansion and component wrapper generation for Chemical HTML frameworks.

28|2|Updated Dec 24, 2023
One-click install
npx skills add https://github.com/chemicallang/chemical --skill macro-code-gen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Macro Code gen
Source: https://github.com/chemicallang/chemical/tree/main/.agents/skills/macro_code_gen
Command: npx skills add https://github.com/chemicallang/chemical --skill macro-code-gen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers understand how macro-based libraries generate code from Chemical HTML components, turning high-level macros into concrete implementation details.

Core Features & Use Cases

  • Macro expansion mapping for #preact, #react, #solid, and #universal.
  • Visualization of generated functions and component wrappers.
  • Use case: onboarding and debugging macro-driven code generation.

Quick Start

Use this skill to inspect how a top-level macro translates into generated HTML component code in Chemical.

Frequently Asked Questions about Macro Code gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does macro-driven HTML code generation work for component frameworks?

Macro-driven HTML code generation works by translating high-level Chemical HTML component macros into concrete generated functions and component wrappers for target frameworks like React, Preact, and Solid.

What is the mapping for macro expansion in Preact, React, and Solid components?

Macro expansion mapping transforms top-level Chemical macros into framework-specific component wrappers and generated functions, documenting specific naming conventions and implementation details for Preact, React, Solid, and Universal outputs.

How do I inspect generated functions from Chemical HTML components?

You inspect generated functions by using the skill to visualize how a top-level macro translates into generated HTML component code, revealing the underlying component wrapper generation and function naming conventions.

Can I use Chemical HTML components with Universal framework targets?

Yes, Chemical HTML components support Universal framework targets. The macro expansion rules document how high-level macros translate into generated functions for the Universal component wrapper alongside Preact, React, and Solid.

Why does my generated component wrapper not match the expected function naming conventions?

Generated component wrappers follow specific macro expansion rules and function naming conventions defined by Chemical. Debugging macro-driven code generation requires inspecting how top-level macros translate into the generated HTML component code.

When do I need to understand macro expansion rules for Chemical HTML?

You need to understand macro expansion rules during onboarding or when debugging macro-driven code generation, as these rules dictate how high-level Chemical HTML components translate into concrete generated functions and component wrappers.