Skip to content

[Proposal] Repository Revamp: New Tech Stack #89

Description

@elizabethlfransen

Overview

I've been studying the code of this repository and I have been really impressed with improvements already made. I would like to help contribute and I have noticed that there is a lot of compatibility code. (For example, checking if crypto is supported, not using es modules, checking browser environments, etc).

I would like to improve developer experience for the repository, and willing to take on the task to do so, but I would like to get approval before proposing these changes in a pull request as a lot of work would be involved.

Who Am I

I'm Liz. I am a web developer who has been working professionally for 7 years and I have an interest for applications that work with binary data.

Proposed Changes

PNPM over NPM

I would like to use pnpm over npm because of it's boost in installation speed and non-flat node_modules directory. See more information here: https://pnpm.io/motivation

Project Structure

I would like to leverage pnpm workspaces and restructure the project that makes sense for all the features that are being developed. The structure would look like so:

  • rom-patcher
    • rom-patcher-js-web (core library re-exported with additional browser support)
    • rom-patcher-js (core library with no browser support)
    • rom-patcher-cli (cli tool for rom patching)
    • rom-patcher-web-app (web app for rom patching)

This structure will help organize the mono repo for contributors and keep web and non-web features separate. This will also improve deployment and publishing packages to npm.

Bundling

I would like to start using Vite for bundling. Vite supports many plugins and takes care of certain features without much thought on our part. A huge feature of this would be usage of the legacy plugin which can polyfill and take care of supporting older browsers and the web workers features of vite. With these features, developers can focus on developing new code.

Testing

I would like to propose using Vitest for testing code. Right now the code is not currently being tested which can lead to quality issues. Introducing a testing framework would allow more quality assurance and faster deployment down the road.

Linting and Formatting

I would like to introduce eslint and prettier to help lint and format the code making the code easier to read and contribute to in the future.

Typescript

I would like to move to typescript as type-safety is very useful for larger projects and automatically generating types from typescript is very helpful for developers using the library.

Roadmap

I would like to implement these changes incrementally to minimize impact. The steps I would like to implement these changes would be::

  • Organization changes
    • Switch to pnpm
    • Setup vite projects and workspace
    • Move code to appropriate projects
  • Linting and formatting
    • Add eslint and prettier and address lint and formatting issues.
  • Add tests to project
    • PRs here should be split up to bite size chunks in order to not make a large amount of changes at once
  • Removing legacy code and let vite handle the supporting legacy browsers
    • Switch to es modules
    • introduce separate web / core library packages
  • Migrate to Typescript

Conclusion

What are your thoughts on these changes, is this something you would be willing to switch to for this project and be able to support? Do you think there would be any benefit to this down the road?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions