Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trixion

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trixion

Ultra light weight web stack bundle

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Trixion

Trixion is an ultra light modern web stack. its goal is to produce a very light bundle yet to support latest conventions.

** Trixion is still in beta stage - please use with care and submit any issue you encounter **

Read about Trixion in Medium

TL;TR

clone the trixion-starter project
and instead of any other dependency you may use (react, react-dom, redux, react-redux, react-router etc)
simply use trixion - its all in there. The whole thing weights ~15kb though (batteries included).

check out the examples

What's in it?

most of the functionality of react, redux, routing, hot-reload...

yet the only dependency is preact.
preact is baked in, so the only package you need is trixion.

  • Component based UI

    • createClass
    • es6 classes
    • functional component
    • object literal components (yes yes... its true)
  • state store

    • simple reducers declaration
    • scoped reducers (on sections of the state)
    • serializing/de-serializing state
    • reducers tree support
    • scoped subscription
    • store connectors with memoization (like reselect + redux-react)
    • persistent state middleware (with local/session storage)
  • html5 routing

    • nested routes
    • async component loading (optional loader)
    • lifecycle hooks
    • async lifecycle hooks!
    • pushing and replacing state without reload
  • some built in helpers

  • lean modern polyfills

But why?

Here is a small table that shows the bundle sizes of common boilerplate
projects for component based + routing + global state store frontend.

All bundles were made with NODE_ENV=production and -p flag for webpack.

Projectstargazersminifiedmin+gzip
react-redux-universal-hot-example5713561.3kb170.3kb
react-redux-starter-kit3864103.8kb38.9kb
react-slingshot3262210.4kb59.3kb
react-isomorphic-starterkit1874229.4kb66.8kb
28kb-react-redux-routing24988kb25.9kb
trixion-56.8kb15kb

So, Why should I use it?

well, you don't...
Most people doesn't seem to care what their bundle size is.
But if any of these apply to you, then know that this project was built for people like you:

  • you care about your bundle size
  • you plan on building large app and understand that small core with lazy loading is the answer
  • you made performance tests and saw the huge impact of large bundles on mobile platforms
  • your DEV environment is too slow to build and reload
  • you're feeling like playing with something new

Lean web - Here We Come!

  • always be aware of your bundle size
  • as much lazy load as possible
  • check the size of each library you use - here are couple of methods

Not in the scope

Some features are not supported in trixion such as async store middlewares, state loggers,
redux related state players/manipulators and many more.

The reasons are:

  • Its still in early stages
  • more use cases usually means larger libs that increase bundle size for everyone
  • simplicity is a bless

docs

if you've never heard of react/preact, redux, redux-react, html5 routing
you are going to find it somewhat difficult to understand as trixion doesn't include the fundamental explanation.
Its recommended to read on each of the modules concepts and principles.

Resources

Exports

Here is a full list of the things that are exported from trixion (lots of them).

Components:
  • DOM
  • $
  • createElement - alias of $
  • E - alias of $
  • Component
  • createClass
  • render
  • findDOMNode
  • unmountComponentAtNode
  • h
  • preact
Store:
  • store
  • dispatch - alias of store
  • addReducer
  • connect - store connector
  • attachPersistence
  • attachSessionPersistence
Routing:
  • Router
  • Link
  • navigate
  • go
  • back
Misc:
  • app - any-purpose global namespace for your use
  • cl - className helper. see examples
  • assign - Object.assign like function
  • setImmediate
  • clearImmediate
  • DEBUG - true if process.env.NODE_ENV !== 'production'
  • parseUri - parse uri to pathname, search and hash

I want to help!

Contribution would be much appreciated.
Either by creating pull requests of opening issues.

FAQs

Package last updated on 17 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc