Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ seedit is a serverless, adminless, decentralized Reddit-style client built on th
- Zustand for shared state
- React Router v6
- Vite
- `@bitsocialnet/bitsocial-react-hooks`
- `@bitsocial/bitsocial-react-hooks`
- i18next
- Corepack-managed Yarn 4
- oxlint
Expand Down Expand Up @@ -77,7 +77,7 @@ src/
### React Architecture Rules

- Do not use `useState` for shared/global state. Use Zustand stores in `src/stores/`.
- Do not use `useEffect` for data fetching. Use `@bitsocialnet/bitsocial-react-hooks`.
- Do not use `useEffect` for data fetching. Use `@bitsocial/bitsocial-react-hooks`.
- Do not sync derived state with effects. Compute during render.
- Avoid copy-paste logic across components. Extract custom hooks in `src/hooks/`.
- Avoid boolean flag soup for complex flows; model state clearly in Zustand.
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"private": true,
"packageManager": "yarn@4.13.0",
"dependencies": {
"@bitsocialnet/bitsocial-react-hooks": "https://codeload.github.com/bitsocialnet/bitsocial-react-hooks/tar.gz/dcfaeaccefc0b9de90ef37c44885ac005eef429a",
"@bitsocial/bitsocial-react-hooks": "0.1.2",
"@capacitor/app": "7.0.1",
"@capacitor/filesystem": "7.1.4",
"@capacitor/local-notifications": "7.0.1",
Expand All @@ -30,19 +30,18 @@
"fs-extra": "11.2.0",
"gifuct-js": "2.1.2",
"http-proxy": "1.18.1",
"i18next": "23.5.1",
"i18next": "25.10.9",
"i18next-browser-languagedetector": "7.1.0",
"i18next-http-backend": "2.2.2",
"i18next-http-backend": "3.0.5",
"json-stringify-pretty-compact": "4.0.0",
"kubo": "0.39.0",
"lodash": "4.18.0",
"memoizee": "0.4.15",
"node-fetch": "2",
"react": "19.1.2",
"react-ace": "14.0.1",
"react-dom": "19.1.2",
"react-dropzone": "14.3.8",
"react-i18next": "13.2.2",
"react-i18next": "16.6.6",
Comment on lines +33 to +44
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 1) Surface every Trans / useTranslation usage so the team can spot-check after the bump.
rg -nP --type=tsx -C2 '\b(Trans|useTranslation)\b' src

# 2) Confirm no leftover `useSuspense` defaults are being relied on implicitly.
rg -nP -C2 'useSuspense|defaultNS|fallbackLng' src public

# 3) Cross-check React-Compiler plugin compatibility note in vite config.
fd -e ts -e js 'vite\..*config' | xargs -I{} sed -n '1,120p' {}

Repository: bitsocialnet/seedit

Length of output: 4756


🌐 Web query:

react-i18next 16 breaking changes from v13

💡 Result:

The primary breaking change when upgrading react-i18next from v13 to v16 is the required upgrade of the peer dependency i18next from >=v23.0.1 (required by v13.0.0) to >=v25.5.2+ (for v16.x, later bumped to >=25.10.9 in v16.6.6). This i18next upgrade introduces several breaking changes that affect react-i18next usage. Key i18next breaking changes impacting react-i18next (from v23 to v25+): - Build process changes: dist/es -> dist/esm, dist/commonjs -> dist/cjs (bundled files instead of individual). - TypeScript typing updates requiring corresponding react-i18next type changes. - Later v25+ changes like peer dep alignments for TransSelector types. react-i18next v16.0.0 itself notes "major upgrade i18next dep to address 1865" with no explicit API breaks listed in its changelog. Post-v16 releases (16.3.0+) include minor fixes like i18n wrappers for React Compiler/memo compatibility and Trans defaultValue handling, but these are not flagged as breaking. Migration steps: 1. Upgrade i18next to >=25.10.9 alongside react-i18next ^16.6.6. 2. Review i18next migration guide for v23->v25: https://www.i18next.com/misc/migration-guide (covers build changes, no major config/API breaks). 3. Check Trans component usage for type errors with selectors (fixed by matching peer deps). 4. Test for bundle/build issues due to new dist structure. 5. No direct react-i18next API changes; mostly transparent via i18next dep.

Citations:


🌐 Web query:

@vitejs/plugin-react 6 breaking changes

💡 Result:

The breaking changes in @vitejs/plugin-react v6.0.0 (released March 12, 2026) are: 1. Remove Babel Related Features: Babel is no longer a dependency. The babel option in the plugin config is removed. Users needing Babel must add @rolldown/plugin-babel separately. For React Compiler, use reactCompilerPreset with it. Example migration: - react({ babel: { plugins: [...] } }) + react, babel({ plugins: [...] }) 2. Drop Vite 7 and below support: Requires Vite 8+. Upgrade if using older Vite. 3. Use Oxc for React Refresh Transform in rolldown-vite: @vitejs/plugin-react-oxc is deprecated; disableOxcRecommendation option removed. 4. react and react-dom no longer added to resolve.dedupe automatically. 5. Remove old babel-plugin-react-compiler support requiring runtimeModule option: Use newer versions supporting target option. v6.0.1 (March 13, 2026) is a patch expanding @rolldown/plugin-babel peer deps, no new breaks.

Citations:


Fix vite.config.ts Babel configuration before upgrading @vitejs/plugin-react to v6.

The package.json versions are pinned correctly. However, the current vite.config.ts will break after the upgrade: @vitejs/plugin-react v6.0.0 removed the babel option from the plugin configuration. The config currently uses:

react({
  babel: {
    plugins: [['babel-plugin-react-compiler', { verbose: true }]],
  },
})

This pattern is no longer supported. You must:

  1. Add @rolldown/plugin-babel as a dependency
  2. Refactor the Vite config to pass Babel plugins via @rolldown/plugin-babel instead of via the react() plugin

See the migration guide.

The i18next 23 → 25 and react-i18next 13 → 16 upgrades are safe: fallbackLng and defaultNS are already explicitly configured in src/lib/init-translations.ts, and no implicit defaults are being silently relied upon. The react-i18next v16 breaking changes are primarily driven by the i18next peer dependency alignment, with no direct API breaks in react-i18next itself. Complete manual UI testing before merge as already planned.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 33 - 44, Add the new dependency
`@rolldown/plugin-babel` and remove the deprecated babel option from the react()
call in vite.config.ts: locate the react({ babel: { plugins: [...] } }) usage
and delete the babel property, import the `@rolldown/plugin-babel` factory (e.g.,
rollupBabel or babelPlugin) at the top of vite.config.ts, instantiate it with
the same Babel plugins (['babel-plugin-react-compiler', { verbose: true }]) and
appropriate helpers/extensions, and add that plugin instance to the Vite plugins
array alongside react(). Ensure you update imports and remove any references to
react().babel so the Babel plugins run via `@rolldown/plugin-babel` instead of the
react plugin.

"react-markdown": "10.1.0",
"react-router-dom": "6.30.2",
"react-router-hash-link": "2.4.3",
Expand All @@ -56,7 +55,6 @@
"zustand": "4.4.3"
},
"scripts": {
"postinstall": "node scripts/patch-bitsocial-react-hooks-esm.cjs",
"start": "node scripts/start-dev.js",
"build": "cross-env NODE_ENV=production PUBLIC_URL=./ GENERATE_SOURCEMAP=false vite build",
"build:preload": "cross-env NODE_ENV=production vite build --config electron/vite.preload.config.js",
Expand Down Expand Up @@ -114,7 +112,7 @@
"@types/memoizee": "0.4.9",
"@types/node-fetch": "2",
"@typescript/native-preview": "7.0.0-dev.20260115.1",
"@vitejs/plugin-react": "4.3.4",
"@vitejs/plugin-react": "6.0.0",
"assert": "2.1.0",
"babel-plugin-react-compiler": "1.0.0",
"buffer": "6.0.3",
Expand Down
4 changes: 2 additions & 2 deletions public/translations/en/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@
"more_posts_last_month": "{{count}} posts last {{currentTimeFilterName}}: <1>show more posts from last month</1>",
"profile_info": "Your account u/{{shortAddress}} was created. <1>Set display name</1>, <2>export backup</2>, <3>learn more</3>.",
"show_all_instead": "Showing posts since {{timeFilterName}}, <1>show all instead</1>",
"subplebbit_offline_info": "The subplebbit might be offline and publishing might fail.",
"posts_last_synced_info": "Posts last synced {{time}}, the subplebbit might be offline and publishing might fail.",
"subplebbit_offline_info": "The community might be offline and publishing might fail.",
"posts_last_synced_info": "Posts last synced {{time}}, the community might be offline and publishing might fail.",
"import_account_backup": "<1>import</1> account backup",
"export_account_backup": "<1>export</1> account backup",
"save_reset_changes": "<1>save</1> or <2>reset</2> changes",
Expand Down
164 changes: 0 additions & 164 deletions scripts/patch-bitsocial-react-hooks-esm.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion src/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ These rules apply to `src/**`. Follow the repo-root `AGENTS.md` first, then use

- Keep route composition in `src/views/`, reusable UI in `src/components/`, shared logic in `src/hooks/`, and shared app state in `src/stores/`.
- Before adding new state, decide whether it belongs in render, a reusable hook, or a Zustand store. Do not duplicate the same state logic across views.
- Use `@bitsocialnet/bitsocial-react-hooks` for data access. Do not add data-fetching `useEffect` calls or effects that only synchronize derived state.
- Use `@bitsocial/bitsocial-react-hooks` for data access. Do not add data-fetching `useEffect` calls or effects that only synchronize derived state.
- When changing React UI logic, run `yarn build`, `yarn lint`, and `yarn type-check`. When changing layout or interaction, verify desktop and mobile behavior with `playwright-cli`.
- Prefer extending nearby tests under `src/**/__tests__/` when touching already-covered behavior.
40 changes: 20 additions & 20 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import PostPage from './views/post-page';
import Profile from './views/profile';
import Settings from './views/settings';
import AccountDataEditor from './views/settings/account-data-editor';
import SubplebbitDataEditor from './views/subplebbit-settings/subplebbit-data-editor';
import CommunityDataEditor from './views/community-settings/community-data-editor';
import SubmitPage from './views/submit-page';
import Subplebbit from './views/subplebbit';
import SubplebbitSettings from './views/subplebbit-settings';
import Subplebbits from './views/subplebbits';
import CommunityView from './views/community';
import CommunitySettings from './views/community-settings';
import Communities from './views/communities';
import AccountBar from './components/account-bar/';
import ChallengeModal from './components/challenge-modal';
import Header from './components/header';
Expand Down Expand Up @@ -90,15 +90,15 @@ const App = () => {
<Route path='/about' element={<AboutView />} />
<Route path='/submit' element={<SubmitPage />} />

<Route path='/s/:subplebbitAddress/c/:commentCid' element={<PostPage />} />
<Route path='/s/:subplebbitAddress/c/:commentCid/about' element={<AboutView />} />
<Route path='/s/:communityAddress/c/:commentCid' element={<PostPage />} />
<Route path='/s/:communityAddress/c/:commentCid/about' element={<AboutView />} />

<Route path='/s/:subplebbitAddress/submit' element={<SubmitPage />} />
<Route path='/s/:subplebbitAddress/about' element={<AboutView />} />
<Route path='/s/:communityAddress/submit' element={<SubmitPage />} />
<Route path='/s/:communityAddress/about' element={<AboutView />} />

<Route path='/settings' element={<Settings />} />
<Route path='/s/:subplebbitAddress/settings' element={<SubplebbitSettings />} />
<Route path='/s/:subplebbitAddress/settings/editor' element={<SubplebbitDataEditor />} />
<Route path='/s/:communityAddress/settings' element={<CommunitySettings />} />
<Route path='/s/:communityAddress/settings/editor' element={<CommunityDataEditor />} />
<Route path='/settings/plebbit-options' element={<Settings />} />
<Route path='/settings/content-options' element={<Settings />} />
<Route path='/settings/account-data' element={<AccountDataEditor />} />
Expand All @@ -112,15 +112,15 @@ const App = () => {
<Route path='/inbox/commentreplies' element={<Inbox />} />
<Route path='/inbox/postreplies' element={<Inbox />} />

<Route path='/communities' element={<Subplebbits />} />
<Route path='/communities/subscriber' element={<Subplebbits />} />
<Route path='/communities/moderator' element={<Subplebbits />} />
<Route path='/communities/admin' element={<Subplebbits />} />
<Route path='/communities/owner' element={<Subplebbits />} />
<Route path='/communities/vote' element={<Subplebbits />} />
<Route path='/communities/vote/passing' element={<Subplebbits />} />
<Route path='/communities/vote/rejecting' element={<Subplebbits />} />
<Route path='/communities/create' element={<SubplebbitSettings />} />
<Route path='/communities' element={<Communities />} />
<Route path='/communities/subscriber' element={<Communities />} />
<Route path='/communities/moderator' element={<Communities />} />
<Route path='/communities/admin' element={<Communities />} />
<Route path='/communities/owner' element={<Communities />} />
<Route path='/communities/vote' element={<Communities />} />
<Route path='/communities/vote/passing' element={<Communities />} />
<Route path='/communities/vote/rejecting' element={<Communities />} />
<Route path='/communities/create' element={<CommunitySettings />} />
</Route>
<Route element={feedLayout}>
<Route path='/:sortType?/:timeFilterName?' element={<Home />} />
Expand All @@ -129,7 +129,7 @@ const App = () => {

<Route path='/s/mod/:sortType?/:timeFilterName?' element={<Mod />} />

<Route path='/s/:subplebbitAddress/:sortType?/:timeFilterName?' element={<Subplebbit />} />
<Route path='/s/:communityAddress/:sortType?/:timeFilterName?' element={<CommunityView />} />

<Route path='/domain/:domain/:sortType?/:timeFilterName?' element={<Domain />} />

Expand Down
2 changes: 1 addition & 1 deletion src/components/account-bar/account-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useRef, useState } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { createAccount, setActiveAccount, useAccount, useAccounts } from '@bitsocialnet/bitsocial-react-hooks';
import { createAccount, setActiveAccount, useAccount, useAccounts } from '@bitsocial/bitsocial-react-hooks';
import { isSettingsView } from '../../lib/utils/view-utils';
import styles from './account-bar.module.css';
import SearchBar from '../search-bar';
Expand Down
Loading
Loading