My suggestion is to refactor both core and adapters to only have named exports.
I came across this article, when I started looking what's most used in the community.
When I looked into the React community I came across well know libraries which were 50-50 divided in the use of only named exports or having a default export too.
Only named:
react-beautiful-dndreact-datesreact-router@reach/router@reach/tabsreact-spinnersreact-virtualizedstimulusrechartsDefault export too:
react itselfturbolinksdownshiftreact-selectBut when looking a bit closer, It stood out to me that the libraries that expose nestable components, only have named exports.
Since InertiaLink is something that needs te be nested in Inertia[Adapter] (just like Link is nested in a Router f.i.), my suggestion is to update all current packages to only export named exports.
This too has the advantage that it will maybe (don't know for sure) be easier to refactor the typings in a more modern way without the use of modules.
Like I said before: I only looked into the React community to see what's commonly used, but I think that if we do it for one of the packages, we should do it for all of them to be consistent.
Ping @reinink @sebastiandedeyne
Since it's 50/50 overall, I don't see any value in investing in this change now, since it doesn't provide any meaningful benefits today.
Yeah, I'd second that. I'm okay with our current approach. I appreciate your research into this though @MichaelDeBoey!
It's worth noting that we did, in the end, choose named exports, as part of the first release. 馃槄
Most helpful comment
Yeah, I'd second that. I'm okay with our current approach. I appreciate your research into this though @MichaelDeBoey!