New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

r18gs

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

r18gs

A simple yet elegant, light weight, react18 global store to replace Zustand for better tree shaking.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
decreased by-3.05%
Maintainers
1
Weekly downloads
 
Created
Source

React18GlobalStore

test Maintainability codecov Version Downloads npm bundle size Gitpod ready-to-code

Motivation

I have built wonderful libraries utilizing React18 features using Zustand. They worked awesome. However, when I try importing from specific folder for better tree-shaking, the libraries fail. This is because, for each import a separate zustand store is created. This actually increases the package size also.

Thus, I decided to create a bare minimum, ultra-light store that creates shared state even while importing components from separate files for better treeshaking.

Will be using this library soon to fix issues with nextjs-themes.

Features

✅ Full TypeScript Support

✅ Unleash the full power of React18 Server components

✅ Works with all build systems/tools/frameworks for React18

✅ Doccumented with Typedoc (Docs)

✅ Next.js, Vite and Remix examples

Install

A canonical package with longer name is also published react18-global-store

$ pnpm add r18gs

or

$ npm install r18gs

or

$ yarn add r18gs

Build

To build all apps and packages, run the following command:

cd r18gs
pnpm build

Develop

To develop all apps and packages, run the following command:

cd r18gs
pnpm dev

🤩 Don't forger to start this repo!

Want hands-on course for getting started with Turborepo? Check out React and Next.js with TypeScript and The Game of Chess with Next.js, React and TypeScrypt

Repo Stats

License

Licensed as MIT open source.


with 💖 by Mayank Kumar Chaudhari

Keywords

FAQs

Package last updated on 22 Feb 2024

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