pdelacroix / vite-plugin-melange

A Vite plugin for Melange
8 stars 2 forks source link

Project status #4

Open dmmulroy opened 7 months ago

dmmulroy commented 7 months ago

Hey Pierre!

I just stumbled upon this project and was wondering what the status of it was - are you actively maintaining it and or planning to continue supporting it?

pdelacroix commented 6 months ago

Hello!

I thought GitHub would email me for new issues but it didn't 😕

As I said on (yet) another platform, I'm planning to continue supporting the project as much as I can, and I'd be more than happy to accept contributions! (and while I'm focusing on an Elixir project at the moment, so I may not find bugs or improvements myself, I'd also have a look if someone were to file a bug report)

By the way I just had a look at your last streaming session, and I managed to reproduce the error you got by adding "type": "module" in the melange project's package.json. Turns out the plugin's package.json was not using the right keys for providing both a CommonJS and a ES module, and it needed to also include "type": "module" . Then there was another error when the melange project didn't include "type": "module", but it was because Vite itself checked that a CommonJS config didn't import an ES module, using the package's package.json, and the file name before that, so I also had to rename the CommonJS entry point. Phew 😅

It was done in f0c137b, released as 2.3.0, and the plugin dependency was updated in the template 🙂

dmmulroy commented 6 months ago

Thanks for the effort and fixes! Myself and a few beta users of create-melange-app have found it pretty tricky to properly configure chokidar and have been getting inconsistent results for HMR.

To get create-melange-app out the door we're going to utilize this approach for vite: https://github.com/dmmulroy/create-melange-app/issues/34#issuecomment-1874516504

We also cut a ticket/issue to refactor this project to use dune rpc because I think having an official vite plugin will be a net positive and boon to the melange ecosystem (and much easier to setup!) 🫶

Issue is here: https://github.com/dmmulroy/create-melange-app/issues/37

pdelacroix commented 3 weeks ago

Hello! I finally got around to try this Dune RPC thing.

Your project dune-rpc-ts pushed me in the right direction, unfortunately using s-tier turned out more difficult than I expected: I got some parsing errors but now that I think of it I think it's because I was trying to deserialize directly what came out of the socket, which was multiple S-expressions at the same time, because I wasn't using the RPC API right. When it deserialized though it had the weird melange encoding for variants and lists which was hard to use from JS 😕

Using a quick and dirty JS parser I eventually got the RPC communication working, it's not the greatest code but I think it's already more solid than the log parsing method. If you have the time to test it, I haven't updated the template yet but the plugin has been published to npm as 3.0.0 🙂

dmmulroy commented 1 week ago

I just saw this! I'll play around with it in the next week or tow 😁 Yeah S-Tier needs some love, but I'm glad you were able to use some of wha I was working on for inspiration 🥂