11ty / 11ty/webc

Define component from string

Open
#39 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
1.4k
Forks
46
Avg merge
10m
Merged PRs (30d)
2

Description

Right now, WebC accepts file paths for component definitions and reads the file during compilation. It would be nice to have a way to pass the component source code directly as a string instead.

webc.defineComponent("my-component", "my-component.webc", "Hello <slot></slot>!")

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the webc.defineComponent entry point and trace how component definitions are currently read during compilation. Implement support for the shown source-string argument while preserving file-path definitions, then verify that both forms compile with the expected component output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.