flarelabs-net / vite-plugin-cloudflare

13 stars 1 forks source link

[DO NOT MERGE] pre-bundling example (POC) #32

Closed dario-piotrowicz closed 1 month ago

dario-piotrowicz commented 1 month ago

[!WARNING] This PR is not really for merging but more just to share the state of things with the prebundling investigation and gather feeback/start a conversation

[!Note] When/if https://github.com/vitejs/vite/pull/18358 gets merged and released I'll probably extract what I did here in our tests and do try to remove as much module fallback logic as we can (Note: tests on users trying to opt-out of pre-bundling should be added as well)

dario-piotrowicz commented 1 month ago

Question

developers/plugins can always opt out of pre-bundling via optimizeDeps.exclude (docs) or optimizeDeps.noDiscovery: true (docs)... if we actually went with prebundling, where does that leave us?

do we simply not support such options?

or do we support them meaning that we would have both pre-bundling and a potential fallback service fallback? (basically recommending the more stable/robust pre-bundling but not forcing it) (this would non-trivially increase maintenance costs...)

jamesopstad commented 1 month ago

Question

developers/plugins can always opt out of pre-bundling via optimizeDeps.exclude (docs) or optimizeDeps.noDiscovery: true (docs)... if we actually went with prebundling, where does that leave us?

do we simply not support such options?

or do we support them meaning that we would have both pre-bundling and a potential fallback service fallback? (basically recommending the more stable/robust pre-bundling but not forcing it) (this would non-trivially increase maintenance costs...)

I think it would be best to just not support these options if we go this route. In my opinion the maintenance burden of keeping the unbundled behaviour alongside this would be too high.

dario-piotrowicz commented 1 month ago

Closing in favour of #37