Skip to content

[FEATURE] Add redirectives to hscript#376

Open
NotHyper-474 wants to merge 1 commit intoFunkinCrew:experimentalfrom
NotHyper-474:feat/polymore-redirects
Open

[FEATURE] Add redirectives to hscript#376
NotHyper-474 wants to merge 1 commit intoFunkinCrew:experimentalfrom
NotHyper-474:feat/polymore-redirects

Conversation

@NotHyper-474
Copy link
Copy Markdown
Collaborator

@NotHyper-474 NotHyper-474 commented Mar 18, 2026

Wat dis do?

Adds a define, POLYMOD_REDIRECT_HSCRIPT that when enabled will redirect imports to hscript to the internal implementation of Polymod. This can be useful, for instance, to allow the HaxeFlixel Debugger console to work without the need of having hscript installed.

Note

Building may break in the future the more the classes are merged together.

@EliteMasterEric EliteMasterEric force-pushed the feat/polymore-redirects branch from 5b6576c to bc69999 Compare April 30, 2026 00:43
@EliteMasterEric EliteMasterEric self-requested a review April 30, 2026 00:43
Copy link
Copy Markdown
Member

@EliteMasterEric EliteMasterEric left a comment

Choose a reason for hiding this comment

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

This is pretty neat, but if you install Polymod and don't have POLYMOD_REDIRECT_HSCRIPT enabled you get errors that make projects fail to build.

Image

@NotHyper-474 NotHyper-474 force-pushed the feat/polymore-redirects branch from bc69999 to 70ec9bc Compare May 3, 2026 01:02
@NotHyper-474
Copy link
Copy Markdown
Collaborator Author

NotHyper-474 commented May 3, 2026

Finally got around to fix that as well, the issue was that you had hscript installed and Polymod was shadowing its files, so I had to scrap the original idea and replace it with a macro instead.

The way it works is quite clever, we just ask Haxe to give us the references that lead to a missing hscript type and replace those with a typedef to a Polymod type. I have to thank Context.onTypeNotFound for even allowing this to be possible.

@NotHyper-474 NotHyper-474 force-pushed the feat/polymore-redirects branch from 70ec9bc to 8be9907 Compare May 3, 2026 01:32
Redirects references to `hscript` types to Polymod ones.
@NotHyper-474 NotHyper-474 force-pushed the feat/polymore-redirects branch from c5b9db4 to d41654c Compare May 3, 2026 19:56
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