{"id":20170319,"url":"https://github.com/marcodpt/component","last_synced_at":"2026-03-19T14:19:26.021Z","repository":{"id":111252193,"uuid":"381362046","full_name":"marcodpt/component","owner":"marcodpt","description":"A component to test, debug and build other components","archived":false,"fork":false,"pushed_at":"2022-05-10T22:28:07.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-03T04:15:59.802Z","etag":null,"topics":["component","hyperapp","microfrontend","microfrontend-architecture","microfrontends"],"latest_commit_sha":null,"homepage":"https://marcodpt.github.io/component/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcodpt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-29T12:46:26.000Z","updated_at":"2023-06-11T09:30:41.000Z","dependencies_parsed_at":"2023-03-13T13:43:04.771Z","dependency_job_id":null,"html_url":"https://github.com/marcodpt/component","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/marcodpt/component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcodpt%2Fcomponent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcodpt%2Fcomponent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcodpt%2Fcomponent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcodpt%2Fcomponent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcodpt","download_url":"https://codeload.github.com/marcodpt/component/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcodpt%2Fcomponent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30188129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T17:33:53.563Z","status":"ssl_error","status_checked_at":"2026-03-06T17:33:51.678Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","hyperapp","microfrontend","microfrontend-architecture","microfrontends"],"created_at":"2024-11-14T01:18:17.847Z","updated_at":"2026-03-06T17:34:21.244Z","avatar_url":"https://github.com/marcodpt.png","language":"HTML","readme":"# Component\n\u003e A component to test, debug and build other components\n\n## Examples\n - [table](https://marcodpt.github.io/component/?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fmarcodpt%2Ftable%2Fsample.js)\n - [form](https://marcodpt.github.io/component/?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fmarcodpt%2Fform%2Fsample.js)\n - [graph](https://marcodpt.github.io/component/?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fmarcodpt%2Fgraph%2Fsample.js)\n - [template](https://marcodpt.github.io/component/?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fmarcodpt%2Ftemplate%2Fsample.js)\n\n## Tests\n - [navbar](https://marcodpt.github.io/component/tests.html?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fmarcodpt%2Fnavbar%2Ftests.js)\n - [table](https://marcodpt.github.io/component/tests.html?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fmarcodpt%2Ftable%2Ftests.js)\n - [form](https://marcodpt.github.io/component/tests.html?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fmarcodpt%2Fform%2Ftests.js)\n - [views](https://marcodpt.github.io/component/tests.html?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fmarcodpt%2Fviews%2Ftests.js)\n\n## Motivation\nCreate a framework agnostic component definition to scale frontend applications\nin the spirit of [micro frontends](https://micro-frontends.org/).\n\n## Definition\nA `component` is a function with the following signature\n\n### component(element, params) \n - DOM node `element`: is the DOM node where the component should be mounted\n - object `params`: is the params that component recieve to mount itself\n - returns function `update(data)`: an optional function to deals with external \n updates request\n   - `data`: the info passed to update component\n\n## Usage\nDefine your component and create an example file in the spirit of\n[this file](https://raw.githubusercontent.com/marcodpt/component/main/example.js).\n\nThen just go to the browser and use the following url:\n\n```\nhttps://marcodpt.github.io/component/#{Your example file url}\n```\n\nTo use self hosted just use the `test` function in the `API` spec\n\nWhen you define your `component` if you are a\n[hyperapp](https://github.com/jorgebucaran/hyperapp) fan like myself,\nconsider using `component` function in the `API` spec. This is by no means\na must, and you are absolutely free to use wherever framework you want, even\nno framework or just a template engine.\n\n## API\n### index.js: function (element, view, params, update)\nA [hyperapp](https://github.com/jorgebucaran/hyperapp) helper to build\ncomponents in this project specification.\n - DOM node `element`: is the DOM node where the component should be mounted\n - function `view(h, text)`: is a function that returns the\n[hyperapp](https://github.com/jorgebucaran/hyperapp) view\nfunction where `h` and `text` are defined by\n[hyperapp](https://github.com/jorgebucaran/hyperapp)\n - object `params`: is the params that will `init`\n[hyperapp](https://github.com/jorgebucaran/hyperapp)\n - function `update(state, data)`: is a function to create the function that \ndeals with external updates request\n   - object `state`: is the\n[hyperapp](https://github.com/jorgebucaran/hyperapp) state\n   - `data`: the info that external updates requests will pass to your\n`component` \n   - return object: An object with the new state of\n[hyperapp](https://github.com/jorgebucaran/hyperapp)\n - returns a `component` as defined in this document\n \n### source.js:  function (data)\nA function that prints to string a variable data that can contain functions, \nobjects, arrays, any sort of javascript data. Used for debugging purposes.\n - `data`: Any javascript variable, can be an object, can contain functions\n\n### test.js: function (element, params)\nThis is a `component` following this document definition.\nTo test your `component` that follows this document definition too.\n - object `params` properties:\n   - string `title`: Is the title of the component\n   - string `gh`: Is the url of your github repo if your want the github ribbon\n   - object `samples`: The keys are the examples name, and the values are the \nexamples `params` passed to your `component` for testing purposes.\n   - string `target`: Is the DOM selector to the element where your component\nshould be mounted\n   - function `comp`: Is your `component` definition following this document.\n   - object `updates`: The keys are the updates names, and the values are the\nupdates `data` passed from parent to your `component`, this is optional, if\nyour `component` does not support updates just ignore this.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcodpt%2Fcomponent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcodpt%2Fcomponent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcodpt%2Fcomponent/lists"}