-
Notifications
You must be signed in to change notification settings - Fork 352
feat: start of cross platform page system #4731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cal/dev-392
Are you sure you want to change the base?
Conversation
|
|
||
| import { defineNuxtPlugin, useState } from '#imports' | ||
|
|
||
| export default defineNuxtPlugin((nuxt) => { |
There was a problem hiding this comment.
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 [ |
There was a problem hiding this comment.
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[] |
There was a problem hiding this comment.
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?
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
@tanstack/vue-querywhich is a cross platformuseAsyncDataalternative - this will only be used in the@modrinth/uipackage and potentially the app frontend in the future?Set up a system inside of@modrinth/uifor automatic page registration on nuxt + app frontend@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/uiinto 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/overviewpackages/ui/src/providers/api-client.ts- abstracted