12/8/2022 0 Comments Liveview 30![]() ![]() Size of other tools taking reference from Q & A Why server-rendered? ts-liveview is provided as a template (rather than a library), hence any part can be modified to suit your need Size Comparison with other tools Tools ![]() The entry point of ts-liveview app can be wrapped as an express middleware LIVEVIEW 30 CODEThe network client code is 0.4K to 0.9K minified, 102x to 45x smaller than socket.io.min.js For screen-reader, text-based browser, and people with slow or unstable network, or simply tried with privacy invading scripts With history.pushState() and PopStateEvent Updates can be triggered by (bi-directional) events from the server or other clients Content chunk is streamed to clients as soon as it's ready, without waiting for client-side javascript bundles nor data requests to start rendering. Response contentful html page directly to GET request. Pay the AST-to-HTML conversion time-cost once at boot-time instead of at each request-time Auto send accumulated offline messages when network resume (WIP).Lightweight WebSocket-based protocols.Support to develop with JSX, AST, or html template.Still functional when javascript is disabled on client device.Enable interactive UI with minimal amount of javascript to be downloaded.Static / dynamic document title and description meta.Write UI and API routing once in one place.Support url-based routing architectures.Request-time server-rendering with HTML streaming.Lint the codebase with eslint and apply auto fix if possible.īuild the frontend and check the size of bundled, minified, and gzipped versions respectively. js extension in import paths, which is required in esm runtime.Īuto format the source code with prettier. Run the built server in 'build' folder (for production deployment).Īuto add. This step is only needed for production mode. LIVEVIEW 30 UPDATEStart the development server, with realtime update and live-reload.Ĭompile the typescript server into 'dist' folder, and bundle the client into 'build' folder. scripts/deploy.sh, which will build and deploy the server with knex migrate and pm2.ĭetails refer to create-ts-liveview Available npm scripts To deploy, setup scripts/config then run. To update database schema, see db/README.md scripts/init.sh, which will run above commands for you. Npm run dev # starts the development server LIVEVIEW 30 INSTALLPnpm install -prefer-offline # you can also install with yarn or npm scripts/create-cert.sh # this create self-signed https cert for local development cd db Npm init ts-liveview my-app # or "npx my-app" for latest version cd my-app ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |