DEV Community

kwst
kwst

Posted on

9 3

Very light frontend development environment

I introduce making a very light frontend evironment (parcel, typescript, hyperapp, picostyle, jest). I wanted to create a frontend development environment immediately for less dependencies and more simple. There are good minimal libraries.

Getting started

yarn init
Enter fullscreen mode Exit fullscreen mode

Minimal frontend libraries

hyperapp

hyperapp
hyperapp is very a light library for front-end JavaScript like React.
If you want to know how to use, you can get started from this article. This is very very small(1.4KB) and no dependencies. This includes also the light function state management like Redux. "Action" can change the "State".

yarn add hyperapp
Enter fullscreen mode Exit fullscreen mode

picostyle

picostyle is a very light library for CSS in JS. This is 0.4KB and also no dependeices. You can use this instead of styled-components.

hyperapp and picostyle was created by the members of the same company.

yarn add picostyle
Enter fullscreen mode Exit fullscreen mode

Module bundler

parcel
parcel is a simple module bundler. This has no complicated config.

yarn add parcel-bundler -D
Enter fullscreen mode Exit fullscreen mode

Transform

TypeScript
I want to use type so I selected TypeScript. "State" of hyperapp should be defined by type so it gets very easy to use the state from components. tslint is linter for TypeScript.
You should add tsconfig.json and tsliny.json.

yarn add typescript tslint -D
Enter fullscreen mode Exit fullscreen mode

Testing framework

Jest
Jest is a testing framework for JavaScript made by Facebook. This is often used with React. I added ts-jest to use TypeScript in this case.

yarn add jest ts-jest @types/jest
Enter fullscreen mode Exit fullscreen mode

And I added setting into package.json for ts-jest.

{
  "jest": {
    "transform": {
      "^.+\\.tsx?$": "ts-jest"
    },
    "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

My test code for hyperapp is here.

Result Project

https://github.com/SatoshiKawabata/parcel-hyperapp-typescript

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️