wk

Source Code (Github)

wk is a CLI tool for developing single-page-applications with web components syntax.

usage

Introduction

wk is a simple and opinionated CLI tool that imposes a simple approach that (only) uses html, css and javascript for writing web applications.

This CLI has 6 simple commands that is sufficient to

Installation

This CLI tool is available through npm.

npm i -g wk-toolkit

Who is this for?

This is an experimental build tool that I use in my own projects, and I don't expect anyone to find this useful and use in their own work.

I have prepared this document for those who really dislikes modern web development and looking for an alternative approach to build web applications.

Since I am biased against modern methods of web development, I tried to get rid of all unnecessary (IMO) frameworks, transpilers, task runners, dependency managers as much as possible and implemented some of their functionality in this CLI in a very minimal way.

Here are the list of the most radical decisions in this web application development method that can show you if this CLI is a good fit for you or not.

1. Imperative over Declarative / Markup and logic separated

Despite writing more code, imperative programming is easier to debug and has less hidden behaviour. Not having the full control on rendering makes trivial problems like 'preventing redundant re-renders' a big issueand forces you to either learn the internals of the declarative rendering logic or blindly follow the constantly-changing-best-practice for that specific problem.

Wk also tries to keep markup and logic separated which is impossible for declerative UI programming. Mixing markup and logic requires you to invent a new language or a new syntax (eg: directives in angular/vue and jsx in react). HTML/JS/CSS are already very high level and powerful concepts and adding another language and there is no need to learn a new programming or markup language ..

2. Manual DOM manipulation

Methods like data binding, virtual DOM are not used in projects developed with wk. Those concepts introduces lots of complexity and mostly ends up writing more code than their Hence all dom manipulation is done manually with using methods and properties like querySelector, cloneNode and , innerHTML. In order to develop web apps with this tool you must be proficient with standart Web APIs and manual DOM manipulation techniques.

3. No 3rd party tool support

WIP As of 2021 any github contains tens of configuration files

CLI Usage

Initializing a project

wk init

Starting development server

wk start

Making a production build

wk build

Documentation

documentation is not complete

A freshly initialized project will have following 5 files

./src/components/web-app/web-app.html
./src/components/web-app/web-app.css
./src/components/web-app/web-app.js
./public/index.html
./jsconfig.json

dont serve the base project folder or public folder yourself for development always use wk start command for development

Style Guide

projects written with wk are encouraged to use following style guide

Changelog

wk is in under active development since 2018 and i have made lots of breaking changes to it, below is the track of all those changes

unfortunately there is no foreseeable date for stable version release yet

Migration Notes 0.4.14 to 0.5.0

July-20-2020

Migration Notes 0.3.0 to 0.3.1

August-26-2019

folder structure is changed with this release (this is a breaking change)

folder name 'com' has an undesired resemblance with Android package names ( eg: com.foo.bar ) i thought having 3 letter base folder names looked cool ( www, src, com) but every developer that tried to use wk, complained with these cryptic namings.

Migration Notes 0.2.22 to 0.3.0

August-18-2019

i have decided to make a breaking change to wk and dropped typescript support

even though i love typescript and typed languages for programming, i had some negative experiences with 'typescript' so far

what is gained by dropping typescript

what is lost by dropping typescript

still, i am not convinced that dropping typescript is a good idea, since wk is still in an experimental stage, i may re-introduce typescript in the future