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

import { defineNuxtPlugin, useState } from '#imports'

export default defineNuxtPlugin((nuxt) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally we just stop using useAsyncData entirely and focus on this for now - migrating as needed.

...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.


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?

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.

2 participants