All Projects → alosaur → angular_deno

alosaur / angular_deno

Licence: other
Angular Deno - Experimental Angular renderer in server with Deno

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to angular deno

AloeDB
Light, Embeddable, NoSQL database for Deno 🦕
Stars: ✭ 111 (+42.31%)
Mutual labels:  deno
crypto
🔐 Fastest crypto library for Deno written in pure Typescript. AES, Blowfish, CAST5, DES, 3DES, HMAC, HKDF, PBKDF2
Stars: ✭ 40 (-48.72%)
Mutual labels:  deno
tsafe
🔩 The missing TypeScript utils
Stars: ✭ 285 (+265.38%)
Mutual labels:  deno
justjavac
justjavac's modules
Stars: ✭ 15 (-80.77%)
Mutual labels:  deno
cotton
SQL Database Toolkit for Deno
Stars: ✭ 129 (+65.38%)
Mutual labels:  deno
dataStructure
Implement different Data Structures using TypeScript and JavaScript. Deno Third-party Module.
Stars: ✭ 24 (-69.23%)
Mutual labels:  deno
sinco
Browser Automation and Testing Tool for Deno, written in full TypeScript
Stars: ✭ 54 (-30.77%)
Mutual labels:  deno
nanoid
A NanoID implementation for Deno
Stars: ✭ 63 (-19.23%)
Mutual labels:  deno
node2deno
Deno for Node.js developers
Stars: ✭ 19 (-75.64%)
Mutual labels:  deno
youtube-sr
Simple library for Node, Deno & Bun to make YouTube search easily
Stars: ✭ 68 (-12.82%)
Mutual labels:  deno
deno-mongo-api
Example for building REST APIS with deno and MongoDB
Stars: ✭ 17 (-78.21%)
Mutual labels:  deno
reno
A thin, testable routing library designed to sit on top of Deno's standard HTTP module
Stars: ✭ 127 (+62.82%)
Mutual labels:  deno
http4ts
Server as a Function http toolkit for TypeScript & JavaScript
Stars: ✭ 30 (-61.54%)
Mutual labels:  deno
kyuko
Fast and easy http framework for Deno Deploy 🦕
Stars: ✭ 18 (-76.92%)
Mutual labels:  deno
deno-pokemon
a simple api to create and explore pokemons - made with oak deno framework
Stars: ✭ 20 (-74.36%)
Mutual labels:  deno
deno math
Deno module for high-precision calculations and scientific computing
Stars: ✭ 21 (-73.08%)
Mutual labels:  deno
denocker
A Docker client library for Deno
Stars: ✭ 23 (-70.51%)
Mutual labels:  deno
microdiff
A fast, zero dependency object and array comparison library. Significantly faster than most other deep comparison libraries and has full TypeScript support.
Stars: ✭ 3,138 (+3923.08%)
Mutual labels:  deno
snatchblock
A strictly typed utility library.
Stars: ✭ 1,059 (+1257.69%)
Mutual labels:  deno
deno registry2
The backend for the deno.land/x service
Stars: ✭ 79 (+1.28%)
Mutual labels:  deno

Angular renderer in Deno

test

Now Supported Angular 12.0.3 and Deno 1.14.0

This is experimental Angular SSR in Deno, and will be used as a renderer for Alosaur web framework, as well as handlebars, ejs, mustache.

How to use

deno run --importmap=importmap.json --location=https://jspm.dev --allow-read main.ts

Declare Angular deps

importmap.json:

{
  "imports": {
    "@angular/core": "https://jspm.dev/@angular/[email protected]",
    "@angular/deno": "https://deno.land/x/angular_deno/mod.ts",
    "@angular/deno/": "https://deno.land/x/angular_deno/",
    "reflect": "https://deno.land/x/[email protected]/src/injection/reflect.ts",
     "zone.js": "https://jspm.dev/zone.js/dist/zone"
  }
}

main.ts:

import { CompilerFactory, enableProdMode } from '@angular/core';
import { bootstrap, CommonEngine } from '@angular/deno';
import { AppModule } from './app.module.ts';

import "reflect";
import 'zone.js';

const { readFile } = Deno;
const decoder = new TextDecoder();

// Read index.html for root parse
const indexHtml = decoder.decode(await readFile('index.html'));

enableProdMode();

// bootstrap main app
const ref: any = await bootstrap(AppModule, indexHtml);

// create renderer engine
const engine = new CommonEngine(ref.injector.get(CompilerFactory), AppModule);


// Render page for URL
const page: string = await engine.render({ document: indexHtml, url: "/" });

app.module.ts:

import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/deno';
import { AppComponent } from './app.component.ts';


@NgModule({
    imports: [ServerModule],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
    providers: []
})
export class AppModule { }

TODO

If the "stars" on this project will be more than 100 ;)

  • Transfer state
  • AOT
  • SASS support

Note

All .mjs files in this repository exported from jspm.dev as ESM module, for example: https://jspm.dev/npm:@angular/[email protected]!cjs

Why platform-server.mjs exported from jspm and not rewrite DominoAdapter? I do not remember, maybe something broke at the moment of redefining providers https://github.com/angular/angular/blob/a6971ba89adc253bfa4260036ee4a1e0bd76159f/packages/platform-server/src/server.ts#L33

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].