Skip to content

Conversation

@IMB11
Copy link
Member

@IMB11 IMB11 commented Nov 7, 2025

Currently this is only going to be used by the servers pages, but I dont see why we cant use this for orgs, users, collections etc.? Out of scope though

  • Sets up @tanstack/vue-query which is a cross platform useAsyncData alternative - this will only be used in the @modrinth/ui package and potentially the app frontend in the future?
  • Set up a system inside of @modrinth/ui for automatic page registration on nuxt + app frontend
  • Migrate server list page as an example of usage
  • Moves api client DI context to @modrinth/ui.

Places to look:

  • packages/ui/src/pages - I tried to make a dynamic page system, however i was running into issues with nuxt, so I think it's probably just easier to just create stubs on the frontend, this isn't great... For the app-frontend we can just pass the page from @modrinth/ui into the route object in the routes.js, which is good.
  • packages/ui/src/pages/servers/manage/index.vue - Take a look at tanstack query, it's a cross platform useAsyncData alternative (that's actually better in most cases) - read more: https://tanstack.com/query/latest/docs/framework/vue/overview
  • packages/ui/src/providers/api-client.ts - abstracted

@IMB11 IMB11 requested a review from Prospector November 7, 2025 11:03
@IMB11 IMB11 added website Relates to Modrinth.com web frontend app Relates to Modrinth App frontend Involves work from the frontend team dev-ex Improvements to developer experience labels Nov 7, 2025
@IMB11 IMB11 marked this pull request as draft November 7, 2025 11:05
@IMB11 IMB11 marked this pull request as ready for review November 9, 2025 14:26
@IMB11 IMB11 changed the title feat: cross platform page system feat: start of cross platform page system Nov 9, 2025
...generatedState,
}

const [
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to api-client, see notion, we need to figure out how we're going to do this (the full thing, not just tags) for the app-frontend.

Copy link
Member

Choose a reason for hiding this comment

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

does this no longer catch errors and display the errors generating state banner?

Copy link
Member Author

Choose a reason for hiding this comment

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

Errors are stored still;

		const errors: unknown[] = []
		// eslint-disable-next-line @typescript-eslint/no-explicit-any
		const handleError = (err: any, defaultValue: any) => {
			console.error('Error fetching state data:', err)
			errors.push(err)
			return defaultValue
		}

Copy link
Member Author

Choose a reason for hiding this comment

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

(Inside the impl)


export interface GeneratedState extends Labrinth.State.GeneratedState {
// Additional runtime-defined fields not from the API
projectTypes: ProjectType[]
Copy link
Member Author

Choose a reason for hiding this comment

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

see other comment, how are we going to handle this on app-frontend?

@IMB11 IMB11 requested a review from Copilot November 11, 2025 23:19
Copilot finished reviewing on behalf of IMB11 November 11, 2025 23:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a cross-platform page system starting with the servers pages. It sets up TanStack Vue Query as a cross-platform alternative to useAsyncData, migrates the server list page to the new @modrinth/ui package, and moves API client dependency injection to @modrinth/ui.

Key changes:

  • Added @tanstack/vue-query as a cross-platform data fetching solution
  • Migrated servers page components to @modrinth/ui package for reuse across app-frontend and frontend
  • Restructured API client types into namespaced modules (Labrinth, Archon, Kyros, ISO3166)
  • Moved API client provider from frontend app to shared UI package

Reviewed Changes

Copilot reviewed 77 out of 80 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-lock.yaml Added @tanstack/vue-query, papaparse, and related dependencies
packages/ui/src/pages/servers/manage/index.vue New cross-platform server list page using TanStack Query instead of useAsyncData
packages/ui/src/providers/api-client.ts New provider for Modrinth API client DI context
packages/ui/src/utils/product-utils.ts New utility functions for product/billing data formatting
packages/api-client/src/modules/labrinth/types.ts Consolidated API types into namespaced Labrinth namespace
packages/api-client/src/modules/archon/* New Archon API modules for server management endpoints
packages/api-client/src/modules/kyros/* New Kyros API modules for filesystem operations
packages/api-client/src/modules/iso3166/* New ISO3166 module for country/subdivision data
packages/api-client/src/modules/labrinth/billing/internal.ts New billing API module with subscription and payment methods
apps/frontend/src/pages/servers/manage/index.vue Simplified to use cross-platform component from @modrinth/ui
apps/frontend/src/plugins/tanstack.ts New Nuxt plugin for TanStack Query setup with SSR support
apps/app-frontend/src/routes.js Added servers route using shared component
apps/app-frontend/src/main.js Registered VueQueryPlugin
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IMB11 IMB11 changed the base branch from cal/dev-392 to main November 13, 2025 01:09
@IMB11 IMB11 changed the base branch from main to cal/dev-392 November 13, 2025 01:10
@IMB11 IMB11 changed the base branch from cal/dev-392 to main November 13, 2025 01:10
@IMB11 IMB11 changed the base branch from main to cal/dev-392 November 13, 2025 01:11
@IMB11 IMB11 force-pushed the cal/dev-391 branch 2 times, most recently from 0a5de4a to 57265da Compare November 13, 2025 19:47
@IMB11 IMB11 changed the base branch from cal/dev-392 to main November 13, 2025 19:47
@IMB11 IMB11 requested a review from Prospector November 14, 2025 08:40
@Prospector Prospector added this pull request to the merge queue Nov 14, 2025
Merged via the queue into main with commit 7ccc326 Nov 14, 2025
4 checks passed
@IMB11 IMB11 deleted the cal/dev-391 branch November 14, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Relates to Modrinth App dev-ex Improvements to developer experience frontend Involves work from the frontend team website Relates to Modrinth.com web frontend

Development

Successfully merging this pull request may close these issues.

3 participants