hn
所属分类:系统/网络安全
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2020-12-28 09:27:53
上 传 者:
sh-1993
说明: 同构黑客新闻
(Isomorphic Hacker News)
文件列表:
LICENSE (765, 2020-12-28)
client/ (0, 2020-12-28)
client/@/ (0, 2020-12-28)
client/@/3rd/ (0, 2020-12-28)
client/@/3rd/uhtml.js (5824, 2020-12-28)
client/@/css/ (0, 2020-12-28)
client/@/css/app.css (3789, 2020-12-28)
client/@/js/ (0, 2020-12-28)
client/@/js/about.js (3754, 2020-12-28)
client/@/js/app.js (9185, 2020-12-28)
client/@/js/hn.js (1974, 2020-12-28)
client/@/js/view.js (7320, 2020-12-28)
client/favicon-128.png (5133, 2020-12-28)
client/favicon-16.png (1835, 2020-12-28)
client/favicon-180.png (7955, 2020-12-28)
client/favicon-192.png (8141, 2020-12-28)
client/favicon-32.png (2349, 2020-12-28)
client/index.html (375, 2020-12-28)
client/manifest.json (459, 2020-12-28)
client/robots.txt (18, 2020-12-28)
client/sw.js (1653, 2020-12-28)
docs/ (0, 2020-12-28)
docs/@/ (0, 2020-12-28)
docs/@/3rd/ (0, 2020-12-28)
docs/@/3rd/uhtml.js (5803, 2020-12-28)
docs/@/css/ (0, 2020-12-28)
docs/@/css/app.css (2920, 2020-12-28)
docs/@/js/ (0, 2020-12-28)
docs/@/js/about.js (3240, 2020-12-28)
docs/@/js/app.js (3227, 2020-12-28)
docs/@/js/hn.js (810, 2020-12-28)
docs/@/js/view.js (3517, 2020-12-28)
docs/about/ (0, 2020-12-28)
docs/about/index.html (1444, 2020-12-28)
docs/ask/ (0, 2020-12-28)
docs/ask/index.html (1444, 2020-12-28)
docs/favicon-128.png (4219, 2020-12-28)
docs/favicon-16.png (1384, 2020-12-28)
... ...
# Isomorphic Hacker News
**Social Media Photo by [AbsolutVision](https://unsplash.com/@freegraphictoday) on [Unsplash](https://unsplash.com/)**
- - -
### [Live static site](https://webreflection.github.io/hn/top/?1).
- - -
The goal of this project is to showcase a 100% isomorphic version of the famous [Hacker News PWA](https://hnpwa.com/), through my tiny [html](https://github.com/WebReflection/uhtml#readme) and [content](https://github.com/WebReflection/ucontent#readme) libraries, able to produce a fully static, yet _SSR_ ready, Hacker News reader.
### Achievements Unlocked
* this _PWA_ works on a 100% static host
* this _PWA_ could be pre-rendered via _SSR_ too
* the client renders everything incrementally
* the server renders everything with, or without, _JS_
* both client and server share exactly the [same view](https://github.com/WebReflection/hn/blob/master/client/%40/js/view.js)
* both client and server share exactly the [same controller](https://github.com/WebReflection/hn/blob/master/client/%40/js/hn.js)
* both client and server logic is route based, meaning each _URL_ can be shared
* no bundlers whatsoever are involved, everything is standards based
* _Lighthouse_ scores ~100% on a _GitHub_ hosted static site
### Extra Details
All you need to do, in order to test this project locally, is the following:
```sh
git clone https://github.com/WebReflection/hn.git
cd hn
npm i
npm test
# npm run test:ssr # for SSR
```
The client side part is within the [client/@/](./client/@/) folder, while the server side part is within the [server/](./server/) folder.
The reason to choose a `@` as folder prefix, is to have a portable pattern that would never interfere with the name of any other possible folder.
As example, the _SSR_ part uses those folders indexes to render each page, but the structure is fully compatible with a static host too.
The client side is served either through [cdn](https://github.com/WebReflection/ucdn#readme), or pre-built via [compress](https://github.com/WebReflection/ucompress#readme), after a npm run build command.
To keep it simple, I have also targeted the docs folder, instead of public, simply to be able to tell _GitHub_ to publish this Web App via such folder.
I hope this project will inspire new, as well as old, Web developers, as it's definitively something anyone could do without needing to move away from plain Web standards
近期下载者:
相关文件:
收藏者: