{"id":20186123,"url":"https://github.com/leolanese/reactjs-interceptor","last_synced_at":"2026-05-06T19:39:11.568Z","repository":{"id":182346666,"uuid":"668349021","full_name":"leolanese/ReactJS-interceptor","owner":"leolanese","description":"Web-Component is a web standard and can be used across different frameworks, as long as the target environment has support for web components. Exporting our Preact component as a web component, we can use it in other frameworks or environments that support web components.","archived":false,"fork":false,"pushed_at":"2023-07-20T08:54:54.000Z","size":28435,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T22:29:19.466Z","etag":null,"topics":["interceptor","preact","react"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leolanese.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-07-19T15:37:03.000Z","updated_at":"2024-06-03T17:22:51.000Z","dependencies_parsed_at":"2024-11-14T07:00:30.401Z","dependency_job_id":null,"html_url":"https://github.com/leolanese/ReactJS-interceptor","commit_stats":null,"previous_names":["leolanese/preact-interceptor","leolanese/reactjs-interceptor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leolanese/ReactJS-interceptor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolanese%2FReactJS-interceptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolanese%2FReactJS-interceptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolanese%2FReactJS-interceptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolanese%2FReactJS-interceptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leolanese","download_url":"https://codeload.github.com/leolanese/ReactJS-interceptor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolanese%2FReactJS-interceptor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27321036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-28T02:00:06.623Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["interceptor","preact","react"],"created_at":"2024-11-14T03:16:03.269Z","updated_at":"2025-11-28T19:04:21.330Z","avatar_url":"https://github.com/leolanese.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PReact interceptor with Web-Component\n\n\u003e Web-Component is a web standard and can be used across different frameworks, as long as the target environment has support for web components. Exporting our Preact component as a `web component`, we can use it in other frameworks or environments that support web components.\n\n```js\nnpm init preact\n\ncd preact-app\n\n// serve http://localhost:5173/\nnpm run dev\n\n// produce portable `/dist`\nnpm run build\n```\n\n## Building the web-component using Vite\n\n\u003e `Preact-custom-element` is a library that allows you to turn any Preact component into a custom element. Custom elements are a powerful way to create reusable and encapsulated web components.\n\n\u003e This package allows you to turn your `Preact components into custom HTML elements that can be used in any HTML or JavaScript environment without requiring a Preact app`\n\n```js\n// run vite to bundle your Preact app\nnpm run build\n\nvite v4.4.4 building for production...\n✓ 52 modules transformed.\ndist/index.html                 0.37 kB │ gzip:  0.28 kB\ndist/assets/index-b89854d8.js  47.46 kB │ gzip: 18.59 kB\n```\n\n## Consuming the Web-Component\n\n```js\nnpm install -g http-server\n\n// cd dist\nhttp-server\n\n// test index.html that load the web-component\nhttp://localhost:5173/\n```\n\n---\n\n## TIPS\n\n```js\n// Missing:\t\u003cdiv id=\"app\"\u003e\u003c/div\u003e \nUncaught TypeError: Cannot read properties of null (reading '__k')\n    at bn (index-18ebafdc.js:1:15413)\n    at index-18ebafdc.js:3:15918\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleolanese%2Freactjs-interceptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleolanese%2Freactjs-interceptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleolanese%2Freactjs-interceptor/lists"}