Skip to content

Conversation

jmcclell
Copy link

@jmcclell jmcclell commented Feb 6, 2024

Some pacakges such as pixi.js re-export 3rd party libraries under their own namespace, e.g. @pixi/util does the following:

export { default as EventEmitter } from 'eventemitter3'

in order to provide the EventEmitter module from eventemitter3 under the @pixi/util namespace.

The converter appears to ignore exports of this form and no module is created. This breaks libraries that rely on this behavior such as Pixi.

NOTE: This test doesn't show any import failures or warnings, but the issue is that the module isn't generated in the output code as expected.

@steinybot
Copy link
Contributor

You need to add the tests to org.scalablytyped.converter.internal.importer.ImporterTest

@jmcclell jmcclell closed this Jul 30, 2024
@jmcclell jmcclell force-pushed the export-default-testcase branch from 6db99bd to 02257bf Compare July 30, 2024 20:28
@jmcclell jmcclell reopened this Jul 30, 2024
Some pacakges such as pixi.js re-export 3rd party libraries under their
own namespace, e.g. @pixi/util does the following:

export { default as EventEmitter } from 'eventemitter3'

in order to provide the EventEmitter module from eventemitter3 under the
@pixi/util namespace.

The converter appears to ignore exports of this form and no module is
created. This breaks libraries that rely on this behavior such as Pixi.
@jmcclell jmcclell force-pushed the export-default-testcase branch from b363b44 to 2039cd5 Compare July 30, 2024 22:23
Copy link
Contributor

@steinybot steinybot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is related to #638.

@@ -0,0 +1 @@
export { default as Foo } from "foo";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would this find foo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to commit these? I'd probably keep a subset of the the real code for pixi-utils rather than creating a ficticious export-default package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants