pl0x-suite
A way of building bundle-less, fine-grained, front-end web apps.
pl0x-suite
is a collection:
-
dist/pl0x.mjs
- Reactive state management which replaces mobx. -
dist/history-pl0x.mjs
- Reactive history to be used withpl0x
. -
dist/routing-pl0x.mjs
- Reactive routing usingpl0x
. -
dist/hyperpl0x.mjs
- A custom implementation ofhyperscript
with support for es modules, and it supports these props:onmount
,unmount
,disabled
,checked
,class
. -
dist/jsx-tag.mjs
- Exposes thehtml
template tag literal by combininghyperpl0x
withhtm
.
If you would like to use JSX instead of html
template tag literals, you can do so using the jsx-convert
package which is not part of the suite.
Each tool in the suite is a file in the dist
folder which can be imported individually using one of these commands:
import {reactive} from "pl0x-suite/dist/pl0x.mjs";
import {history} from 'pl0x-suite/dist/history-pl0x.mjs'
import {registerRoute} from 'pl0x-suite/dist/routing-pl0x.mjs'
import hyperscript from "pl0x-suite/dist/hyperpl0x.mjs";
import html from 'pl0x-suite/dist/jsx-tag.mjs'
Recommended Web App Structure
This is the recommended way to use pl0x-suite
:
- Your frontend codebase should have these folders:
node_modules
,build
- Use
absolute-import-paths --glob "build/**/*.{js,mjs}"
in your build step to convert bare import paths into absolute ones by prepending them with/node_modules/
. This will cause the browser to make requests to/node_modules
on the same origin. - Expose
/node_modules
from your origin server.