-
Notifications
You must be signed in to change notification settings - Fork 20
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
Dodge HaxeFoundation/Haxe#11338 by also looking at imported types #62
Conversation
Seems good now for Shiro's projects. |
What is the minimum Haxe version supported by domkit? This PR uses a Haxe 4.3.0 feature ( |
Can you tell me which cases this is trying to solve ? It seems a bit overly complex. |
The problem is that domkit abused HaxeFoundation/haxe#9150 by importing |
There are more subtlety that I need to list and detail after reconstructing the failing cases (the ones from when I opened this PR but also the ones I found later that this PR didn't fix). |
Can repro the initial issue with dune:
Init macros add this as components path: domkit.Macros.registerComponentsPath("ui.hud.$UI"); Module We cannot resolve There is also this case: domkit.Macros.registerComponentsPath("h2d.domkit.BaseComponents.$Comp"); For which I added the As to why I replaced |
If we don't care about checking packages there (should be very niche issue, but still technically possible), this can be reduced to: var path = p.split("$").join(uname);
// Note: might be nice to expose such a tool (dotpath => type path) in our macro API, if that's not already available..
var tpath = {pack: [], name: "", sub: null};
for (p in path.split(".")) {
if (p.charCodeAt(0) >= 'a'.code && p.charCodeAt(0) <= 'z'.code) {
tpath.pack.push(p);
} else {
if (tpath.name == "") tpath.name = p;
else if (tpath.sub == null) tpath.sub = p;
}
}
var t = try {
Context.getType(path);
} catch(e:Dynamic) {
try Context.getType(tpath.sub ?? tpath.name) catch(e:Dynamic) continue;
} |
@kLabz thanks for the description of the issue in relation to the actual code involved. |
That wouldn't work here either because |
Yeah I meant "$UI"
Le sam. 18 janv. 2025, 13:24, Rudy Ges ***@***.***> a écrit :
… That wouldn't work here either because $ would resolve to SpectatorTopBar,
not SpectatorTopBarUI
—
Reply to this email directly, view it on GitHub
<#62 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZXQHTJ4MNRONVBI3TFU32LJBWZAVCNFSM6AAAAABS5MNWY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZGY4TKOJQGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Seems to work indeed for dune 👍 |
See HaxeFoundation/haxe#11338