preactjs - react의 subset, simple, lightweight library

Fast 3kB alternative to React with the same modern API


관련 자료

https://preactjs.com/

 

Preact: Fast 3kB alternative to React with the same modern API. Components & Virtual DOM.

 

preactjs.com

https://github.com/developit/preact/

 

developit/preact

⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM. - developit/preact

github.com

https://www.slant.co/versus/10513/15409/~react_vs_preact

 

Slant - React vs Preact detailed comparison as of 2019

Comparison of React vs Preact detailed comparison as of 2019 and their Pros/Cons

www.slant.co

 



 

 

A different kind of library.

Closer to the Metal

Preact provides the thinnest possible Virtual DOM abstraction on top of the DOM. The web is a stable platform, it's time we stopped reimplementing it in the name of safety.

Preact is also a first-class citizen of the web platform. It diffs Virtual DOM against the DOM itself, registers real event handlers, and plays nicely with other libraries.

Small Size

Most UI frameworks are large enough to be the majority of an app's JavaScript size. Preact is different: it's small enough that your code is the largest part of your application.

That means less JavaScript to download, parse and execute - leaving more time for your code, so you can build an experience you define without fighting to keep a framework under control.

Big Performance

Preact is fast, and not just because of its size. It's one of the fastest Virtual DOM libraries out there, thanks to a simple and predictable diff implementation.

It even includes extra performance features like customizable update batching, optional async rendering, DOM recycling, and optimized event handling via Linked State.

Portable & Embeddable

Preact's tiny footprint means you can take the powerful Virtual DOM Component paradigm to new places it couldn't otherwise go.

Use Preact to build parts of an app without complex integration. Embed Preact into a widget and apply the same tools and techniques that you would to build a full app.

Instantly Productive

Lightweight is a lot more fun when you don't have to sacrifice productivity to get there. Preact gets you productive right away. It even has a few bonus features:

  • props, state and context are passed to render()
  • Use standard HTML attributes like class and for
  • Works with React DevTools right out of the box

Ecosystem Compatible

Virtual DOM Components make it easy to share reusable things - everything from buttons to data providers. Preact's design means you can seamlessly use thousands of Components available in the React ecosystem.

Adding a simple preact-compat alias to your bundler provides a compatibility layer that enables even the most complex React components to be used in your application.

 

 

[그림1] preactjs logo

 

preact의 목표

Preact는 몇 가지 주요 목표를 달성하는 것을 목표로합니다.

성능 : 빨리고 효율적으로 렌더링
크기 : 작은 크기, (3.5kb 약) 경량
효율성 : 효과적인 메모리 사용 (재활용, GC 쓰레기 방지)
이해 : 코드베이스를 이해하는 데 몇 시간 이상 걸리지 않아야합니다.
호환성 : Preact는 반작용 API와 대부분 호환되도록하는 것을 목표로하고있다. preact-compat은 가능한 한 React와 많은 호환성을 달성하려고 시도합니다.

  • A component model for building composable UI
  • Routing
  • Layouts
  • Forms and validation
  • Dependency injection
  • JavaScript interop
  • Live reloading in the browser during development
  • Server-side rendering
  • Full .NET debugging both in browsers and in the IDE
  • Rich IntelliSense and tooling
  • Ability to run on older (non-WebAssembly) browsers via asm.js
  • Publishing and app size trimming












Babel - Use next generation JavaScript, today

(javascript compiler)


참조 URL
  1. http://babeljs.io/
  2. http://babeljs.io/docs/learn-es2015/

 



 현재 최신의 브라우저에서 지원되지 않는 ECMAScript 6 문법으로 작성된 자바스크립트를 변환, 컴파일하여 브라우저가 인식할 수 있는 스크립트를 만들어 주는 라이브러리다.


[ 그림 1 ] Babel 변환 예












webpack - module bundler


참조 URL
  1. http://webpack.github.io/
  2. https://github.com/webpack/webpack
  3. http://webpack.github.io/docs/tutorials/getting-started/

 


 자바스크립트의 모듈을 묶어주는 node기반 툴이다.






























Respond.js - IE 6 ~ 8 에서 미디어 쿼리를 지원


참조 URL
  1. https://github.com/scottjehl/Respond
  2. http://helloworld.naver.com/helloworld/81480
  3. http://blog.daum.net/dosman1/674
  4. http://www.slideshare.net/ssuserc45cfd/ss-15480124





IE 6 ~ 8에서는 미디어 쿼리를 지원하지 않지만 'Respond.js'을 이용하면 부분적으로 나마 지원하게 할 수 있다. 아래와 같이 코드를 수정하면 된다.


[코드1] Respond.js 파일 설치 예제




그리고 실제 미디어 쿼리에 맞는 CSS 파일을 아래와 같이 HTML에 추가하면 된다.


[코드2] 미디어 쿼리 예제


Backbone + Chaplinjs 채플린


참조 URL
  1. http://chaplinjs.org/


Backbone으로 큰 규모의 SPA를 구현하기 위해 지원하는 프레임워크가 Chaplinjs 프레임워크다. 















Amazing Web Library


참조 URL
  1. http://a-web.me/index.html



АWeb library is a powerful, compact and incredibly fast and convenient javascript-library that combines the most advanced technologies to create professional web sites on pure html. Site development will be similar to putting together a puzzle. Beautifully designed visual components cover most of the requirements of the modern internet. Smooth and impressive animations will amaze your users. Mastering the library does not take much of your time, but you will feel the benefit from its use immediately.



애니메이션 라이브러리이자 소량의 Visual Component가 내재되어 있다.















Moment.js

( 시간이나 날짜 관련 라이브러리 )


참조 URL
  1. http://momentjs.com/
  2. https://github.com/moment/moment
  3. http://www.devcurry.com/2013/08/using-jquery-and-momentjs-in-aspnet-mvc.html#.Uikzr7iwewU
  4. http://www.codersgrid.com/2013/07/13/introduce-to-moment-js-and-moment-timezone/



시간이나 날짜 관련 라이브러리다.

웹 페이지에서 언어에 따르는 날짜 포맷을 지원해야 한다면 Moment.js를 사용해 보면 좋을 것이다.






Front end 웹 개발 프레임 워크 - twitter bootstrap html5 boilerplate, foundation


참조 URL
  1. http://html5boilerplate.com/
  2. http://foundation.zurb.com/
  3. http://getbootstrap.com/
  4. http://bootstraphero.com/
  5. http://bootstraphero.com/the-big-badass-list-of-twitter-bootstrap-resources



 웹 디자인에 정형화된 코드의 집합체인 프레임워크는 종류가 다양하다. 그 중에 Html5Bolierplate와 Foudataion, Twitter Bootstrap가 가장 유명하다. 그 중에 Twitter Bootstrap와 연계되어 개발이 진행중인 연관 프로젝트가 가장 활성화가 잘 되고 있다.


Html5Boilerplate은 가장 기본적인 기능만을 미리 선언해 두었으며 IE 버전에 따라 다르게 동작하도록 하는 기능정도만이 추가 되어 있어서 나머지 CSS는 추가적으로 모두 작업을 해야만 한다.


Foudation은 Html5Boilerplate 보다는 많은 부분을 다루고 있다. 그리드 시스템, 버튼, 탭, 슬라이드를 만들 수 있는 스타일 시트와 자바스크립트를 제공한다. 그렇지만 BootStrap 처럼 포괄적으로 제공하고 있지는 않다.


Twitter.BootStrap은 웹 페이지 제작에 필요한 거의 모든 요소를 만들 수 있게 제공이 되고 있다. HTML페이지에 테그와 선택자만 입력해도 사용할 수 있으며 같이 제공되는 자바스크립트도 점더 세련되게 사용자와 반응 할 수 있도록 한다.


그래서 전체적인 지원 범위를 비교해 보면 아래와 같을 것이다.



Html5Boilerplate < Foudation < Twitter.Strap



밑바탕 부터 차근 차근 개발이 필요한 사이트는 Html5Boilerplate를 사용하면 될것이고 디자인이나 레이아웃 그리고 브라우져마다 다른 특이점을 고려하기 힘든 상황이라면 Twitter.Bootstrap를 이용해서 필요한 부분만 수정하여 웹 사이트를 개발하면 쉽게 이쁘고 확장성이 있는 멋진 웹 사이트를 제작할 수 있을 것이다.













+ Recent posts