apollo-utils icon indicating copy to clipboard operation
apollo-utils copied to clipboard

Provide esm version

Open tobiasdiez opened this issue 1 year ago • 5 comments

With more and more build tools (vite, nuxt, etc) going towards an esm-first build, it would be nice if a proper esm interface could be provided, i.e. transpile and distribute esm version, including correct export declaration in package.json.

tobiasdiez avatar Mar 04 '23 04:03 tobiasdiez

@tobiasdiez yeah, I think we knew this should happen eventually - thanks for the nudge. Got a PR open for it. I'll test out the builds next week, should be able to get it merged and published in a number of days. If you don't mind trying out the builds that would be great!

trevor-scheer avatar Mar 04 '23 22:03 trevor-scheer

Hey @tobiasdiez I'd like to nudge again. this fix would cut 100kb from my app bundle size. Thank you

floydspace avatar Jul 10 '23 20:07 floydspace

@floydspace the changes on the linked PR take after Apollo Server's approach, which has been updated once already and is awaiting another fix from a contributor who has offered to implement the change. I'd like to wait until that change lands, then I can follow up with an equivalent update on #259.

trevor-scheer avatar Jul 10 '23 20:07 trevor-scheer

Hey @trevor-scheer, I see that the other fix is not really moving for quite a while. Any chance we can get the ball running on this one?

d3c0d3dpt avatar Nov 16 '23 10:11 d3c0d3dpt

My #259 PR follows Apollo Server's pattern. I don't think Apollo Server has it right currently, so I'm reluctant to adopt the same pattern until we figure out the right one. I unfortunately haven't had time to investigate this and I'm not sure when that might happen. Ref: https://github.com/apollographql/apollo-server/issues/7625

If anyone feels motivated to solve the TS + CJS/ESM dual-package problem in a monorepo I would love to see that. The results of my limited investigation up to this point are documented in the linked issue. There's potentially some tooling that could help us there if we bend it to our will but I haven't tried anything out yet.

trevor-scheer avatar Nov 16 '23 22:11 trevor-scheer