OpenComponents (OC) is an open-source JavaScript framework designed for developing and distributing server-side rendered HTML components, often described as 'serverless in the front-end world'. It abstracts infrastructure complexities, allowing development teams to build, publish, and consume front-end components seamlessly. Components can include Node.js logic for data fetching, along with HTML, CSS, and client-side JavaScript, supporting popular frameworks like React or Angular. The current stable version is 0.50.44. While continuously developed, the project notes that the API is still under heavy development and prone to change. Key differentiators include its focus on server-side rendering, transparent scaling, and a registry-based distribution model that allows components to be consumed via HTTP endpoints.
npm install ocVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to start a minimal local OpenComponents registry using the `Registry` class, serving components from a specified directory.
Refer to the project's CHANGELOG.md and official documentation before upgrading. Pin exact versions or use a dependency management strategy that allows for manual review of updates.
Ensure you are using the correct OpenComponents package for your specific task. `oc` is for building custom registries or advanced framework extensions.
Upgrade your Node.js environment to version 18 or newer using a version manager like nvm (Node Version Manager).
Ensure you are using `import { Registry } from 'oc';` in an ESM context. If using CommonJS, confirm the package structure still supports `require('oc').Registry` directly for your version, or check if it's a default export: `const Oc = require('oc'); const Registry = Oc.Registry;`Convert your consuming module to ESM by adding `"type": "module"` to your `package.json` or changing your file extension to `.mjs`, then use `import { ... } from 'oc';`.Run the script with appropriate permissions, or change the `componentsDir` path to a location where the process has write access (e.g., `/tmp` or a user-specific directory).
No dependency data recorded yet.