{"id":13424169,"url":"https://github.com/alosaur/angular_deno","last_synced_at":"2025-04-02T04:31:40.478Z","repository":{"id":37607248,"uuid":"275567224","full_name":"alosaur/angular_deno","owner":"alosaur","description":"Angular Deno - Experimental Angular renderer in server with Deno","archived":false,"fork":false,"pushed_at":"2021-10-15T17:38:51.000Z","size":283,"stargazers_count":84,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T16:13:27.172Z","etag":null,"topics":["angular","deno"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/alosaur.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}},"created_at":"2020-06-28T11:08:33.000Z","updated_at":"2024-09-14T14:04:43.000Z","dependencies_parsed_at":"2022-08-18T14:51:33.888Z","dependency_job_id":null,"html_url":"https://github.com/alosaur/angular_deno","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alosaur%2Fangular_deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alosaur%2Fangular_deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alosaur%2Fangular_deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alosaur%2Fangular_deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alosaur","download_url":"https://codeload.github.com/alosaur/angular_deno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246757384,"owners_count":20828893,"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","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":["angular","deno"],"created_at":"2024-07-31T00:00:49.715Z","updated_at":"2025-04-02T04:31:35.470Z","avatar_url":"https://github.com/alosaur.png","language":"JavaScript","readme":"# Angular renderer in Deno\n\n![test](https://github.com/alosaur/angular_deno/workflows/test/badge.svg)\n\nNow Supported Angular 12.0.3 and Deno 1.14.0\n\nThis is experimental Angular SSR in Deno, and will be used as a renderer for [Alosaur](https://github.com/alosaur/alosaur) web framework, as well as handlebars, ejs, mustache. \n\n## How to use\n\n`deno run --importmap=importmap.json --location=https://jspm.dev --allow-read main.ts`\n\nDeclare Angular deps\n\nimportmap.json:\n```json\n{\n  \"imports\": {\n    \"@angular/core\": \"https://jspm.dev/@angular/core@12.0.3\",\n    \"@angular/deno\": \"https://deno.land/x/angular_deno/mod.ts\",\n    \"@angular/deno/\": \"https://deno.land/x/angular_deno/\",\n    \"reflect\": \"https://deno.land/x/alosaur@v0.34.0/src/injection/reflect.ts\",\n     \"zone.js\": \"https://jspm.dev/zone.js/dist/zone\"\n  }\n}\n```\n\nmain.ts:\n\n```ts\nimport { CompilerFactory, enableProdMode } from '@angular/core';\nimport { bootstrap, CommonEngine } from '@angular/deno';\nimport { AppModule } from './app.module.ts';\n\nimport \"reflect\";\nimport 'zone.js';\n\nconst { readFile } = Deno;\nconst decoder = new TextDecoder();\n\n// Read index.html for root parse\nconst indexHtml = decoder.decode(await readFile('index.html'));\n\nenableProdMode();\n\n// bootstrap main app\nconst ref: any = await bootstrap(AppModule, indexHtml);\n\n// create renderer engine\nconst engine = new CommonEngine(ref.injector.get(CompilerFactory), AppModule);\n\n\n// Render page for URL\nconst page: string = await engine.render({ document: indexHtml, url: \"/\" });\n```\n\napp.module.ts:\n\n```ts\nimport { NgModule } from '@angular/core';\nimport { ServerModule } from '@angular/deno';\nimport { AppComponent } from './app.component.ts';\n\n\n@NgModule({\n    imports: [ServerModule],\n    declarations: [AppComponent],\n    bootstrap: [AppComponent],\n    providers: []\n})\nexport class AppModule { }\n```\n\n## TODO \n\nIf the \"stars\" on this project will be more than 100 ;)\n\n- [ ] Transfer state\n- [ ] AOT\n- [ ] SASS support \n\n### Note\n\nAll .mjs files in this repository exported from jspm.dev as ESM module, for example:\nhttps://jspm.dev/npm:@angular/platform-server@10.2.4!cjs\n\nWhy platform-server.mjs exported from jspm and not rewrite DominoAdapter?\nI do not remember, maybe something broke at the moment of redefining providers\nhttps://github.com/angular/angular/blob/a6971ba89adc253bfa4260036ee4a1e0bd76159f/packages/platform-server/src/server.ts#L33\n","funding_links":[],"categories":["Инструменты"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falosaur%2Fangular_deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falosaur%2Fangular_deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falosaur%2Fangular_deno/lists"}