Open wherget opened 1 year ago
This is definitely a usecase we want to support (just like Storybook, so please do contribute if you get somewhere with this). But you're right, there is something off with the overlayfs/memoryfs and I'm not quite sure right now how it's supposed to work together with the cache
Somewhat related PR: https://github.com/parcel-bundler/parcel/pull/8857
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
đ bug report
Admittedly this is a bit of an advanced Parcel setup, I'm currently trying to use an
OverlayFS
of aMemoryFS
andNodeFS
asinputFs
to Parcel. I'm doing this to generate ephemeral entry files in-memory for use in a storybook build.After writing Snapshots on first shutdown (i.e. when
.parcel-cache
was empty), further attempts to run the same setup fail, since the snapshot cannot be read fromMemoryFS
.đ¤ Expected Behavior
This works independent of whether a snapshot exists in the parcel cache.
đŻ Current Behavior
đ Possible Solution
I can imagine multiple ways to handle this, some of which may not be sensible, but unfortunately I lack the insight into parcel to suggest which might be the best.
OverlayFS
could, similar to other places, ignore the exception on thereadableFs
and only report events from thewritableFs
. https://github.com/parcel-bundler/parcel/blob/349a6caf40ec8abb6a49fcae0765f8f8deb2073d/packages/core/fs/src/OverlayFS.js#L167-L183MemoryFS
could first try to compute events by loading (the current behaviour), and failing that, construct appropriate (probablycreated
orupdated
) events for all files.MemoryFS
before runninggetEventsSince
in order for regularEvent
lookup to proceed.My current workaround is the first one, but that doesn't seem like the right thing to do for when e.g. the
OverlayFS
is longer-lived, say across multipleParcel.run()
s, where an actual snapshot file may exist inMemoryFS
.đť Code Sample
đ Your Environment