SunsetFi

Results 23 comments of SunsetFi

The current behavior is to send an Accept header containing every documented return type (eg: `Accept: foo/bar foo/baz`). In practice, this makes our server choose the first entry. This prevents...

Okay, so there are two issues at play here: The first is this line: https://github.com/module-federation/core/blob/1f1a544eff0b046fe700b9371b5f823888006e01/packages/runtime-core/src/utils/load.ts#L253 Vite (rollup) has no idea that isBrowserEnv() will always return true in our env, and...

# Why is the CommonJS build of @module-federation/runtime used? ## @module-federation/vite does not properly expose its ESM build @module-federation/vite is lacking a `module' property in its package.json pointing at its...

I found the last piece of the puzzle. For some unexplained reason, @module-federation/runtime is being interpreted as CommonJS, and is therefor getting wrapped in a CommonJS-to-ESM shim, preventing tree shaking....

Aha! I found the root issue! So first of all, my hacks above do *not* result in a functioning build. There is a very good reason rollup is assuming @module-federation/runtime...

So this is going to be a much bigger project than I realized. I believe I might still tackle it but it depends on work priorities. ## loadShare modules need...

Here is a fully functional implementation of the Simple option above: https://github.com/SunsetFi/vite-module-federation-createScriptNode/tree/preshaken-runtime I have created a new ESM library "module-federation-runtime-vite" that: - Replaces the `isBrowserEnv` call with `true` [here](https://github.com/SunsetFi/vite-module-federation-createScriptNode/blob/708a2070f827b49759dff69661024f11b854e521/packages/module-federation-runtime-vite/vite.config.ts#L25) -...

I decided to break this down into a few different PRs, to take things step by step and ensure I don't change too much or break anything: 1. [x] Move...

Yes, we want to publish `@module-federation/vite-runtime`. Initially it won't have a 'latest' tag, and I would like to also publish a copy of `@module-federation/vite` with an alpha tag at a...

@gioboa Any movement on this? Can we get the new NPM package?