All Projects → cristianbote → Hnpwa Vanilla

cristianbote / Hnpwa Vanilla

Licence: mit
Hacker News PWA implemented using no framework just javascript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Hnpwa Vanilla

Elm Hn Pwa
Hacker News as a PWA built with Elm
Stars: ✭ 43 (-82.45%)
Mutual labels:  hacker-news, pwa, service-worker
Nextjs Pwa
Build a PWA with Next.JS
Stars: ✭ 132 (-46.12%)
Mutual labels:  hackernews, pwa
Productivity Frontend
Productivity Application - Kanban Style Productivity Management Application with Customizable Boards, Lists and Cards to Make You More Productive.
Stars: ✭ 234 (-4.49%)
Mutual labels:  pwa, service-worker
Pwafire
Progressive Web Apps API of APIs
Stars: ✭ 137 (-44.08%)
Mutual labels:  pwa, service-worker
Hexo Pwa
Hexo PWA plugin
Stars: ✭ 116 (-52.65%)
Mutual labels:  pwa, service-worker
Sharer.js
🔛 🔖 Create your own social share buttons. No jquery.
Stars: ✭ 1,624 (+562.86%)
Mutual labels:  hackernews, vanilla-javascript
Monitaure
🔔 A server uptime monitoring progressive web application - NO LONGER MAINTAINED
Stars: ✭ 135 (-44.9%)
Mutual labels:  pwa, service-worker
Offline Gallery
🎈 A 16kb Preact & Redux based Progressive Web App that offers an offline gallery experience of external images.
Stars: ✭ 90 (-63.27%)
Mutual labels:  pwa, service-worker
Notes
Offline-first notepad PWA
Stars: ✭ 163 (-33.47%)
Mutual labels:  pwa, service-worker
Pwatter
Angular Progressive Web App using Workbox
Stars: ✭ 167 (-31.84%)
Mutual labels:  pwa, service-worker
Devo
A Chrome and Firefox extension that displays GitHub Trending, Hacker News, Product Hunt and Designer News on every new tab.
Stars: ✭ 236 (-3.67%)
Mutual labels:  hacker-news, hackernews
Bento Starter
🍱 Full-Stack solution to quickly build PWA applications with Vue.js and Firebase
Stars: ✭ 1,519 (+520%)
Mutual labels:  pwa, service-worker
Pwa Cookbook
personally website
Stars: ✭ 107 (-56.33%)
Mutual labels:  pwa, service-worker
Service Worker Detector
This extension detects if a website registers a Service Worker.
Stars: ✭ 124 (-49.39%)
Mutual labels:  pwa, service-worker
Next Offline
make your Next.js application work offline using service workers via Google's workbox
Stars: ✭ 1,306 (+433.06%)
Mutual labels:  pwa, service-worker
Pwa
Progressive Web Apps for Rails
Stars: ✭ 133 (-45.71%)
Mutual labels:  pwa, service-worker
Ember Service Worker
A pluggable approach to Service Workers for Ember.js
Stars: ✭ 227 (-7.35%)
Mutual labels:  pwa, service-worker
Ionic Pwa
🚀 Build a Progressive Web App with Ionic and Angular. Push Notifications. Deployed to Firebase Hosting. The Complete guide to build your PWA. Service Workers. Lighthouse. Web Manifest
Stars: ✭ 87 (-64.49%)
Mutual labels:  pwa, service-worker
Pwastats
A directory of Progressive Web App case studies.
Stars: ✭ 88 (-64.08%)
Mutual labels:  pwa, service-worker
Learning Pwa
📱some samples and blogs about how to start with your first PWA
Stars: ✭ 162 (-33.88%)
Mutual labels:  pwa, service-worker

Plain Javascript(no framework) Hacker News Example

See this application live at: https://hnpwa-vanilla.firebaseapp.com

This is an example of a PWA built using no framework for view manipulation just Webpack for bundling and service worker. Do think of this as the way to build your application using no framework - my 2 cents.

Made with ❤️ in Cluj-Napoca, Transylvania 🏰

Icons made by Freepik Freepik from www.flaticon.com is licensed by CC 3.0 BY

Installation

  1. Clone the repo
  2. Run npm install
  3. Run npm run dev and would spun up a server locally and watch

Details

I've built this as an experiment to see if, native/vanilla javascript, can beat the PWA scores on https://hnpwa.com/ As soon as I finish the implementation, I'd be posting the Lighthouse report. Things are going so good so far. There are a couple of thing that I had to do, in order to make it speedier. Check it out!

Component based composition

So, we must acknowledge the path that React opened, for view composition, moving the composition part in javascript, leaving you focused on what exactly you'd like to accomplish.

Therefore, my take on the composition was pretty straightforward with a React-like approach, but using the native dom-api.

So a component would look like

import { div, a } from '../core/dom-api';

export const myCustomNavigation = (props) => {
    return div(
        { className: 'my-custom-navigation' },
        [
            a({ href: '/' }, 'Home'),
            a({ href: '/about' }, 'About'),
            a({ href: '/contact' }, 'Contact')
        ]
    )
};

As you can see, it's pretty darn similar to React/Preact and the bunch. There's no magic happening behind the scene. If you peek inside ./core/dom-api.js you'll see that everything is split and there's just one createElement function, which returns a function that will actually create the component based on the params given: props, and content.

I'll let you explore more. :)

Feedback welcomed!

Feel free to drop a line, file an issue and so on. Much appreciated!

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].