Inertia: Refactor to only named exports

Created on 20 May 2019  路  4Comments  路  Source: inertiajs/inertia

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:

Default export too:

But 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.

Most helpful comment

Yeah, I'd second that. I'm okay with our current approach. I appreciate your research into this though @MichaelDeBoey!

All 4 comments

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. 馃槄

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reinink picture reinink  路  5Comments

mpskovvang picture mpskovvang  路  5Comments

ninjaparade picture ninjaparade  路  4Comments

ambethia picture ambethia  路  5Comments

philippkuehn picture philippkuehn  路  3Comments