Skip to content

Fix dynamic Import issue with function-defined externals#7060

Merged
mununki merged 2 commits into
masterfrom
fix-fun-dynamic-import
Oct 1, 2024
Merged

Fix dynamic Import issue with function-defined externals#7060
mununki merged 2 commits into
masterfrom
fix-fun-dynamic-import

Conversation

@mununki
Copy link
Copy Markdown
Member

@mununki mununki commented Sep 30, 2024

Fixes #6985

This PR fixes that the dynamic imports don't work correctly with external declarations that define functions.

@module("mylib") external f: string => unit = "default"
let mylibF = Js.import(f)

compiled to

let mylibF = import("mylib").then(m => m.default);

@zth
Copy link
Copy Markdown
Member

zth commented Oct 1, 2024

I'm not familiar with this part of the code base, but it looks good to me from what I can tell. @cristianoc ?

@mununki mununki merged commit 70700fe into master Oct 1, 2024
@mununki mununki deleted the fix-fun-dynamic-import branch October 1, 2024 17:18
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.

Dynamic import doesn't work with external that defines a function

3 participants