npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

reactus

v0.0.14

Published

Reactus is an un-opinionated, un-routed React app build engine

Downloads

7

Readme

Reactus

An un-opinionated, un-routed version of a React app build engine. There are many great React frameworks, most notably Next.js and Razzle each helping developers setup their React app faster than traditional tooling. Reactus is a lite version of a React framework, focused on generating bundles via Webpack.

Use Reactus if:

  • You want to define your own custom file structure
  • You want to create your own React framework
  • You have spent an exhaustive amount of time looking at Webpack's code.
  • You like to work with bare metal libraries

Do not use Reactus if:

  • You want an out of box full stack solution
  • You want a Zero config framework

Navigation

1. Install

$ npm i --save reactus

2. Usage

The following examples show how to use reactus in detail.

3. Customizing

This section will show how reactus can be changed to fit your project needs.

3.1. Use a Custom Entry File

Used to be a quick start point, reactus uses a pre-defined entry file. You can change this with the following snippet of code.

//#FILE: [ROOT]/src/engine.js
...
engine.set('source', 'entry', '/absolute/path/to/your/entry/file.js')
...

Additionally in your own [ROOT]/webpack.config.js, you can simply point the entry directly to your file.

3.2. Use a Custom Router File

Used to be a quick start point, reactus uses a pre-defined router file. You can change this with the following snippet of code.

//#FILE: [ROOT]/src/engine.js
...
engine.set('source', 'router', '/absolute/path/to/your/router/file.jsx')
...

If you are using your own custom entry file like in 3.1. Use a Custom Entry File, you can directly import your custom router from there.

3.3. White Labeling

If you are creating your own framework using reactus, you may want to change the brand name. You can do this with the following snippet of code.

//#FILE: [ROOT]/src/engine.js
...
engine.set('label', 'your_framework')
...

This way, virtual files can be accessed like your_framework/views/product/detail.jsx for example.

3.4. Adding Custom Virtual Files

If you want to declare custom virtual files, you can do so like the following snippet.

//#FILE: [ROOT]/src/engine.js
...
engine.set('map', 'node_modules/reactus/custom.js', '/absolute/path/to/your/code');
...

This way, virtual files can be accessed like reactus/custom for example. map is formed as engine.set('map', target, source) where the following parameters are accepted.

  • target - the virtual file path (can be a file or folder)
  • source - the actual path where the file is located, or;
  • source - the actual path where the folder is located, or;
  • source - the string code to place in the virtual file.

3.5. Use a Custom Page

Used to be a quick start point, reactus uses a pre-defined entry file. You can change this with the following snippet of code.

//#FILE: [ROOT]/src/engine.js
...
engine.set('page', '/absolute/path/to/your/Page.jsx')
...

NOTE: If you are using the default Router.jsx, we pass hydrated data using script#react-data in the Page component