yerkopalma / blank-app-shell Goto Github PK
View Code? Open in Web Editor NEW:construction: Nothing to see here (yet)
Home Page: https://blank-app-shell.now.sh/
:construction: Nothing to see here (yet)
Home Page: https://blank-app-shell.now.sh/
gh-pages for projects use as prefix the project name, so whiole navigating, the router overwrite it and popstate begin to fail
import RouterSingleton from './RouterSingleton'
// route definition
const router = RouterSingleton.getRouter()
router.addRoute('/', HomeView)
router.addRoute('/about', AboutView)
router.addRoute('/user/:id', UserView)
// programatic navigation
router.goTo(route) // could also receive a string for the route path
// current view
router.currentPath // Route object
// could also handle a state container
router.setStateManager(Store)
// expect an object with a redux-like API
// in this case, the app state now has a 'currentRoute' object,
// if changed through an action or reducer, it trigers a route change
Views are supposed to be yo-yo
functions
Anchor tags with a data-route
property also trigger views, e.g.
<a data-route="/">Home</a>
<a data-route="/user/123">John Profile</a>
A route object has the following API
const route = new Route('/path/:id', viewFn)
route.pattern // something like '/path/:id', set on constructor
route.path // the current path, set on navigation
route.params // in this example, an object like { id: 'value' }, only set if path is set
route.view // the yo-yo function
It must have a redux like API
import createStore from './'
const reducers = {
increment (state, data) => data ? state + data : state++,
decrement (state, data) => data ? state - data : state--
}
var state = 0
const store = createStore(state, reducers)
store.subscribe(() => console.log(store.getState()))
store.dispatch('increment') // 1
store dispatch('increment') // 2
store.dispatch('decrement', 12) // -10
Should be offline firendly, save a copy of the state to IDB, always. Store is a singleton. Must have a way to change and interact with the router
Use now to deploy a simple node server. This server will later send the push notifications
Support prioritization of components using requestIdleCallback with requestAnimationFrame. After that implemented, move to a Progressive Booting, for that these (I hope) are the steps:
index.html
is somewhat server rendered, but still going to add it as a proof of concept).ref #6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.