Skip to content

Latest commit

 

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ccmjs Hello Component

A minimal example component for the ccmjs framework.

This component renders a simple greeting using a configurable name.

🚀 Quick Start

Include ccmjs and start the component:

<!DOCTYPE html>
<meta charset="UTF-8">
<body>

<script src="./libs/framework/ccm-28.0.0.min.js"></script>

<script>
ccm.start("./ccm.hello.mjs", {
  name: "Mika"
}, document.body);
</script>

💡 Example Output

Hello Mika

⚙️ Configuration

Configuration is defined directly in the component source code.

Open ccm.hello.mjs to see all available configuration options and their descriptions.

This follows the ccmjs principle of code transparency: all configuration is documented where it is defined.

🧩 Component Structure

A ccmjs component exports a component object:

export const component = {
  name: "hello",
  ccm: "././libs/framework/ccm-28.0.0.min.js",
  config: {
    name: "World"
  },
  Instance: function () {
    this.start = async () => {
      this.element.textContent = "Hello " + this.name;
    };
  }
};

🔍 Code Transparency

Each ccmjs component is a standalone file that can be inspected at runtime.

No build step is required to develop or use ccmjs components. An optional release workflow provides minification, source maps, and integrity hashes.

You can always:

  • read the original source code
  • understand how the component works
  • inspect it directly in the browser (via source maps)

📚 Learn More

📦 Usage with CDN (versioned)

<script
    src="https://cdn.jsdelivr.net/gh/ccmjs/hello@v1.0.3/libs/framework/ccm-28.0.0.min.js"
    integrity="sha384-HDMeDDgKlR2OFJ3ECMwmA6wknqpfpeCiSZYlUhQaFg9FKrvHJp8MMSwrxibvWJ2G"
    crossorigin="anonymous"
></script>
<script type="module">
  ccm.start(
      "https://cdn.jsdelivr.net/gh/ccmjs/hello@v1.0.3/ccm.hello-1.0.3.min.mjs#sha384-3dtmKvcukK9126rQXFXN30Fv7nB63v8gghrzE0Ub7pTv6WhvVcqZqwqc0VuGmhmr",
      { name: "Mika" },
      document.body
  );
</script>

📄 License

MIT License

About

Minimal ccmjs component example that renders a configurable greeting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages