Skip to content

feat: load max-level enchantments from backend - #345

Open
cataladev wants to merge 5 commits into
SkyCryptWebsite:devfrom
cataladev:feat/move-max-enchant-to-api
Open

cataladev wants to merge 5 commits into
SkyCryptWebsite:devfrom
cataladev:feat/move-max-enchant-to-api

Conversation

@cataladev

Copy link
Copy Markdown

Description

Moving the const list of enchantments into the backend (view other pr here)

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🎨 Style/UI changes
  • ♻️ Code refactoring (no functional changes, no api changes)
  • ⚡ Performance improvements
  • 🧪 Adding or updating tests
  • 🔧 Build/CI changes
  • 🧹 Chore (maintenance, dependencies, etc.)

Related Issues

Changes Made

Screenshots/Videos

Testing

  • I have tested these changes locally
  • I have added tests that prove my changes work as expected (if appropriate)

Test Environment

  • OS:
  • Browser:
  • nodejs version:
  • pnpm version:

Checklist

  • My code follows the project's style guidelines
  • I have used conventional commits for all commit messages
  • I have added necessary documentation (if appropriate)
  • I have added tests that prove my changes work as expected (if appropriate)
  • I have added changesets if my changes should be reflected in the changelog
  • I agree that my contributions are licensed under GNU AGPLv3, except changes to explicitly listed MIT brand assets.
  • I confirm that I have the right to submit all code, assets, generated files, and other materials included in this PR under the applicable project terms.

Code Quality Checks

  • pnpm lint passes without errors
  • pnpm format has been run (or no formatting issues exist)
  • pnpm build completes successfully

Additional Notes

Deployment Notes

@changeset-bot

changeset-bot Bot commented Sep 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1f9c4b4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skycrypt-frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cataladev

Copy link
Copy Markdown
Author

flagging src/routes/+layout.server.ts, unsure if its super duper necessary may be a better way to do that? if so lmk

@DarthGigi DarthGigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are some things that aren't quite right or not following the code/codebase standards. But that's fine, ur new and are here to learn :)

If you need help and/or have any questions, feel free to @ or dm on on Discord

Comment thread src/routes/+layout.server.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't use +page.server.ts or +layour.server.ts for data loading anymore (except when we need SSR, like for embeds).

We use Remote Functions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This entire file should be deleted now.

A new enchants context should be defined in createContext.svelte.ts so it matches the implementation of both Packs and AllStats constants loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not a constant but a helper/utility, so it should be placed in $lib/shared/helper.ts (and the file deleted like I said)

Comment thread src/routes/+layout.svelte

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should look at how we handle AllStats (setAllStatsContext) and do the same for enchantments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should not be loaded in the +layout file as its only needed in 1 place, /stats

@DarthGigi

Copy link
Copy Markdown
Member

Also, I'd add a patch changeset for this

@DarthGigi DarthGigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few more changes needed

Comment thread src/routes/+layout.svelte

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should not be loaded in the +layout file as its only needed in 1 place, /stats

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not a constant but a helper/utility, so it should be placed in $lib/shared/helper.ts (and the file deleted like I said)

@DarthGigi DarthGigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think these are the last changes needed?

Comment thread src/context/createContext.svelte.ts Outdated
}

export class EnchantmentsContext {
#current: string[] = $state([]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

string[]? If some data comes from the api it should use the types from orval. I think it's ListEnchantmentsResponse in this case? Unsure tho you'd have to verify

Comment thread src/lib/layouts/stats/Main.svelte Outdated
data: ModelsStatsOutput;
allStats: ModelsStatData[];
combined: ModelsCombinedOutput | null;
enchantments: string[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

data: ModelsStatsOutput;
allStats: ModelsStatData[];
combined: ModelsCombinedOutput | null;
enchantments: listEnchantmentsResponse["data"];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was referring to ListEnchantmentsResponse from orval-generated-zod.ts, we don't really use stuff like ["data"].

I think it should be typeof ListEnchantmentsResponse? I don't quite remember how to "convert" a zod type to a typescript type off the top of my head

@DarthGigi DarthGigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:)

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.

2 participants