Skip to content
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

Singularise 'libraries' and 'compilers' api endpoints #932

Merged
merged 2 commits into from
Dec 17, 2023

Conversation

mkst
Copy link
Collaborator

@mkst mkst commented Dec 17, 2023

The /api/compilers endpoint will still work (i.e. for decomp-permuter looking up decomp.me compilers when import.py is run with --decomp.me).

Copy link
Member

@bates64 bates64 left a comment

Choose a reason for hiding this comment

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

Can you also update the frontend to use the singular endpoints? Should mostly be a find-replace job

@mkst
Copy link
Collaborator Author

mkst commented Dec 17, 2023

Can you also update the frontend to use the singular endpoints? Should mostly be a find-replace job

lol that was incredibly dumb of me :) done.

Do you know why we dont use SWR for the initial get to compilers+platforms?

export default async function NewScratchPage() {
    const compilers = await get("/compiler")  // y no SWR() ?

    return <main>
        <h1 className="text-2xl font-semibold tracking-tight text-gray-12 md:text-3xl">Start a new scratch</h1>
        <p className="max-w-prose py-3 leading-snug">{DESCRIPTION}</p>
        <NewScratchForm serverCompilers={compilers} />
    </main>
}

@bates64
Copy link
Member

bates64 commented Dec 17, 2023

That's a server component so we can just await a request like that. SWR is for client components only

@ethteck ethteck merged commit 301907d into main Dec 17, 2023
6 checks passed
@ethteck ethteck deleted the singularise-api-endpoints branch December 17, 2023 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants