Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGE-ES6 - Using the engine as a module\project reference is broken by recent change #479

Open
beyond-code-github opened this issue Apr 26, 2023 · 4 comments

Comments

@beyond-code-github
Copy link
Contributor

beyond-code-github commented Apr 26, 2023

This change below has resulted in a subtle difference in the generated .js file for the index of the module. This wouldn't be apparent unless you are referencing IGE as a module or via a typescript project reference (I am doing the latter).

ige/index.ts

Line 3 in 6d0b289

export * from "@/engine/instance";

It seems to be that the compiler is having difficulty following the custom paths starting with '@' when processing an export directive. I tried to work around it by replacing import { ige } from "@irrelon/ige"; with import { ige } from "@/engine/instance.js"; but there's a further snafu which means that if there are no imports of the index.ts file then you don't pull in the ige-specific extensions to the Event type defined there, which breaks compilation as well.

@Irrelon Could this change be rolled back?

@markhughes
Copy link

Use npm run fixPaths :)

@beyond-code-github
Copy link
Contributor Author

beyond-code-github commented Apr 28, 2023

Thanks for the suggestion! Unfortunately it had no effect on the contents of index.js

@Irrelon
Copy link
Owner

Irrelon commented May 2, 2023

This change below has resulted in a subtle difference in the generated .js file for the index of the module. This wouldn't be apparent unless you are referencing IGE as a module or via a typescript project reference (I am doing the latter).

ige/index.ts

Line 3 in 6d0b289

export * from "@/engine/instance";

It seems to be that the compiler is having difficulty following the custom paths starting with '@' when processing an export directive. I tried to work around it by replacing import { ige } from "@irrelon/ige"; with import { ige } from "@/engine/instance.js"; but there's a further snafu which means that if there are no imports of the index.ts file then you don't pull in the ige-specific extensions to the Event type defined there, which breaks compilation as well.

@Irrelon Could this change be rolled back?

Hey ya! Are you consuming the engine via its compiled js files or directly via the ts files?

The /index.js file should have the contents:

export * from "engine/instance";

So the custom TypeScript paths shouldn't interfere. If you are using the engine via TS directly, it's not a setup I've tried, could you throw together a barebones example project of how you're doing it so I can debug from my end? A github project I can clone would be great.

@beyond-code-github
Copy link
Contributor Author

Hi mate, sorry for the delay I've been on holiday for a couple of weeks back in England. Will try to put something together for you asap.

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

No branches or pull requests

3 participants