Code Monkey home page Code Monkey logo

phs-map's People

Contributors

dependabot[bot] avatar lishaduck avatar parkerh27 avatar petalcat avatar

Stargazers

 avatar

Watchers

 avatar

phs-map's Issues

Error Recovery

When the user makes a mistake and reloads, we don't let them fix their mistake.

CSS

After I removed most inline styles, the button for moving between classes no longer gets un-display:none'd.

Level 0 Cropping

Level 0's cropped differently from levels 1 and 2, and so it doesn't line up.

Bump Deps

Dependabot doesn't support bun, so I turned it off. Currently, some deps are outdated as a result. As a side note, we might want to use renovate because it does support bun.

Refactor Data Types

Might improve perf, will definitely improve DX and error messages.

Tasks

Code

/**
* Represents the schema for a list of profiles.
*/
// TODO(ParkerH27): Make this a Map.
const profilesListSchema = z.union([
z.tuple([profilesSchema]).rest(profileSchema),
z.tuple([]),
]);

/**
* Represent the level data.
*/
// TODO(ParkerH27): Use a Set here.
type Level = number[][];

Doesn't Restore Classes Fully

In localstorage, we write all of the classes, but when we restore classes from localstorage, only the first class is restored. I think we're passing in the wrong data to createCourse, but I'm not sure.

Vite

You wouldn't need fonts/ or pathing/, they'd be automatically bundled without needing them to be checked in.

CI

Everything works fine locally, but vite, both 4 & 5 are acting up in CI.

Strict Quirks

When we migrated to ESM, it implied strict mode. I simply added a bunch of globals, so there are probably some behavior quirks. Let's scope those variables to go back to the old behaviors.

Code

PHS-Map/src/script.ts

Lines 56 to 83 in 48bbe96

// If not marked with //, should be able to remove at a later time.
let grid: Level; //
let canvas: HTMLCanvasElement; //
let ctx: CanvasRenderingContext2D; //
let coursesAmt: number; //
let viewLvl: Lvl;
let profiles: ProfilesList = []; //
let source: HTMLImageElement;
let size: number;
let profNum: number;
let prof: number;
let numNext: number;
let start: Room;
let end: Room;
let stinv1: number;
let stinv2: number;
let x1: number;
let y1: number;
let flr1: Lvl;
let x2: number;
let y2: number;
let flr2: Lvl;
let sx1: number;
let sy1: number;
let px = 1;
let py = 1;
let old: number;

Yarn + Nx

Background

Turbo and Bun are a pain. Turbo's lack of coloring is so bothersome that I think we should switch to Nx, and anyway Nx has better perf nowadays. Bun is so new, it's not well supported. Thus, I propose using Yarn instead seeing as it's more complete and as of v4, it also has pnpm's speed and doesn't use zero-installs, which were why we'd used pnpm previously.

Refs:

Use `zod-validation-error`

We currently don't show any validation errors, we just silently fail. That's a bad user experience. Let's use the zod-validation-error to create user-friendly errors, and then wire them up so that they can be seen by users so that there's feedback when they make a mistake.

Monorepo-ize

Keeping the Map and the Calculator is sync is getting annoying. Now that Tailwind's Oxide engine and LightningCSS integration is in alpha,1 there's no longer a major reason for us not to put everything in a single monorepo. This would involve using Bun's https://bun.sh/docs/install/workspaces feature, and properly configuring Turborepo.

Footnotes

  1. I hadn't wanted to keep them together if one would need PostCSS and the other wouldn't. โ†ฉ

Local Storage

Currently, getting data back from localstorage is a pain and very buggy. We should fix that! I'm planning on using Zod to manage validation, and re-doing all of the state using it. Async is potentially faster for larger data, and using unstorage allows for cross-platform storage in the future. Hopefully, the increased type-safety from Zod will help the API enough to help me fix the bugs.

Switch default branch

Hey, @ParkerH27! I got the branch stuff to work, so if you could go to the branches page and fix the default branch, that would be most obliging. Once that's happened, the @PSDTools version can be deleted, and then you can switch the owner of this repo to be @PSDTools. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.