Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Rust→WASM npm package (@danu/danu) and a Vite-based frontend that consumes it, plus DHT storage/router changes to improve initial sync behavior and realm discovery notifications.
Changes:
- Introduce
package/crate with wasm-bindgen exports (DaNode, realm helpers, event plumbing) and npm packaging/build scripts. - Add
frontend/Vite app wired to load the local-built WASM package during development. - Update
flmodulesDHT storage internals to trigger initial realm sync when the first node connects and to emit realm ID updates when new realms are created.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| package/src/lib.rs | WASM init entry point + module exports. |
| package/src/events.rs | Bridges internal node/DHT/network events to a JS callback. |
| package/src/darealm.rs | wasm-bindgen wrappers for RealmID/FloID and realm page accessors. |
| package/src/danode.rs | JS-facing DaNode API (node bootstrap, realm access, events). |
| package/package.json | Defines scoped npm package metadata and published artifacts. |
| package/README.md | Documents install/usage for the new npm package. |
| package/Makefile | wasm-pack build helpers (dev vs release) + npm pack. |
| package/Cargo.toml | New WASM crate manifest and dependencies. |
| package/.gitignore | Ignores wasm-pack output and node/cargo artifacts. |
| package/.cargo/config.toml | Sets wasm32 build target for the package crate. |
| frontend/vite.config.ts | Vite config + local alias to ../package/pkg and HTTPS dev server. |
| frontend/tsconfig.json | TS compiler settings for the Vite client app. |
| frontend/src/style.css | Basic UI styling for the frontend status/log view. |
| frontend/src/main.ts | Frontend bootstrapping + wiring NodeStatus events to UI/logs. |
| frontend/package.json | Frontend deps/scripts; consumes @danu/danu via local file link. |
| frontend/package-lock.json | Lockfile for frontend dependencies. |
| frontend/index.html | Static UI shell for the Vite app. |
| frontend/.gitignore | Ignores frontend build and dev artifacts. |
| flnode/src/node.rs | Minor import change (log). |
| flmodules/src/dht_storage/intern.rs | DHT storage sync-on-first-node + realm update emissions; internal message handling refactor. |
| flmodules/src/dht_router/broker.rs | Adds documentation on NodeList message meaning. |
| Makefile | Adds frontend_dev convenience target. |
| Cargo.toml | Excludes package and frontend from workspace members. |
| CHANGELOG.md | Notes new package/frontend and DHT storage behavior changes. |
| .zed/settings.json | Adds ./package/Cargo.toml to rust-analyzer linked projects. |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Also improves dht_storage somewhat
a36fab0 to
566a675
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
@danu/danunpm-package and a frontend which uses it.