Re: Double wildcard "re-exports"... off-limits forever?

2020-02-14 Thread Ben Wiley
Augusto, I think the rest import/export could be an interesting idea although it doesn't quite solve my case since I would like to keep the original names and treat one API as an override of the other (in your case it seems you're trying to combine all exports from multiple libraries by changing

Re: Double wildcard "re-exports"... off-limits forever?

2020-02-14 Thread Augusto Moura
If I understand it correctly, I had a similar problem with generated apis from OpenApi, two apis have a error definition with the name ApiError, i want to reexport all classes (a lot of model definitions) from both apis. The problem is that using `export * from 'api-a'; export * from 'api-b';`

Re: Double wildcard "re-exports"... off-limits forever?

2020-02-14 Thread Ben Wiley
@Jordan: yes that also works, but for a less trivial example that is annoying to maintain. I prefer to narrow in sources of truth where possible. But yes that would satisfy the app user requirements, just make the library dev's job more annoying. @Guy: no unintentional sorry. The intent was to

Re: Double wildcard "re-exports"... off-limits forever?

2020-02-14 Thread Guy Bedford
Did you mean to have both examples use ‘export const a = 1’? This ambiguous export case is supposed to be an explicit error from the spec. If the export is being stripped and not throwing an error sounds like a possible browser bug. On Fri, Feb 14, 2020 at 09:09 Jordan Harband wrote: >

Re: Double wildcard "re-exports"... off-limits forever?

2020-02-13 Thread Jordan Harband
Wouldn't the solution be, don't use `import * as`, but instead, explicitly import and re-export what you want? On Thu, Feb 13, 2020 at 8:02 PM Ben Wiley wrote: > Apologies if this has already been talked about at length at some point. I > was unable to find much in the way of relevant

Double wildcard "re-exports"... off-limits forever?

2020-02-13 Thread Ben Wiley
Apologies if this has already been talked about at length at some point. I was unable to find much in the way of relevant discussions. I found a compelling use case for something which seems to be off-limits in the JavaScript language, that is wildcard re-exporting where the same export name