`plebbit-js` v0.0.7 is out, bringing a lot of optimization for speed and efficiency while reducing load on Plebbit nodes.
**Important Note on Backward Compatibility:** This v0.0.7 release includes changes that may not be fully backward compatible with much older versions of `plebbit-js` or related tools. Moving forward, we will aim to minimize breaking changes.
## Key Upgrades:
* **More Stable:** Reduced crashes, especially "sqlite and state lock errors" for self-hosters.
* **Faster & Lighter:**
* **Revamped Database Layer:** We've rewritten our database interactions to use `better-sqlite3` directly, stripping away the overhead of ORM (Object-Relational Mapping) libraries. Many database operations that previously involved multiple SQL queries processed by JavaScript have been consolidated into single, more efficient SQL queries. This means faster database access and less JS processing.
* **Hyper-Efficient Updates:** Drastically fewer network requests for comment/subplebbit updates (e.g., 3-4 instead of 200+). No more re-downloading existing data.
* **More Posts, Less Fetching:** Main community records now hold 150+ posts (up from 50), reducing separate network requests.
* **CPU Savings:** New `plebbitOptions.validatePages` option significantly cuts CPU load, especially on browsers/mobile.
* **Less Storage:** No more temporary comment update files on disk.
* **New Admin Tools:**
* **Programmable Rules (Publication Match Challenges):** Admins can use "regex" to set custom content rules (e.g., requiring usernames to end with `.eth`, keyword checks).
* **Full Content Deletion (`commentModeration.purged`):** Completely remove comments, their replies, and associated votes/edits.
* **Remote Config (`plebbit.createSubplebbitEdit()`):** `owner` or `admin` roles can directly edit community settings (title, description, rules, flairs) by publishing an edit to the running subplebbit.
* **Voting Control:** Admins can disable up/downvotes for posts and replies within `subplebbit.features`
* **Developer Update:**
* **Faster Domain Resolution with Viem via WebSockets:** Resolving ENS names or other blockchain-based domains using Viem is now significantly more efficient thanks to added WebSocket support.
* **Clearer Feedback & State Management:** `plebbit-js` now emits more granular `updatingState` change events during loading processes. For example, you might see states like "resolving-address", "fetching-ipns" (for subplebbits), or "fetching-update-ipfs", "resolving-subplebbit-address" (for comments), in addition to "waiting-retry" or "succeeded". This gives developers a clearer view of what's happening behind the scenes when a comment or subplebbit is being fetched and updated.
## How to Update:
* **Direct `plebbit-js` Users:** Upgrade to latest CI build on Github.
* **`plebbit-cli` Users:** Upgrade your `plebbit-cli` installation. See [https://github.com/plebbit/plebbit-cli](https://github.com/plebbit/plebbit-cli) for instructions.
* **Frontend Users (Seedit, plebchan, etc.):**
* **Web:** Wait for your frontend to update.
* **Desktop Apps:** Update the app when a new version is released.
## Next Up:
* Full P2P in browsers/mobile via Helia & libp2p (browsers/mobile as full nodes for fetching/publishing, but not running subs).
* Ongoing performance and feature enhancements.
---
Enjoy the update!