Skip to content

Conversation

@marcustyphoon
Copy link
Collaborator

@marcustyphoon marcustyphoon commented Jan 8, 2025

A bit of experimentation with PNPM workspaces. This moves the yaml data into its own workspace package.

I concluded that this isn't as useful as one might think, as:

  • The types for the yaml data aren't self-contained; they reference other files in the repository
  • The yaml files can either be served directly (in which case they're only useful if a third party consumer has a yaml import plugin in their bundler and if they manually enable transpilation of this specific dependency) or built with a build step (which prevents HMR in this repository unless we run a build server in watch mode just for this yaml package)

It's thus not really elegant to publish a subpackage on npm/jsr, and the only point of using a workspace package instead of a subfolder is to get namespaced imports instead of path imports. Who cares?

This was pretty informative, though; the actual thing that could be useful is splitting this repo into a calculation package that can be embedded on a different website and an optimizer.discretize.eu package (i.e. for discretize/discretize.eu-rewrite#36). It would be a quite large amount of moving files around, though, and the redux store files really contain most of the types required to feed meaningful data into what would be the calculation package, so it really isn't that useful either.

[draft previews]

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Deployed preview build to Cloudflare!

Last commit: 2827702
Preview URL: https://cd695ec4.discretize-gear-optimizer.pages.dev
Branch Preview URL: https://yaml-workspace.discretize-gear-optimizer.pages.dev

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.

1 participant