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

-f removes exports used by other exports #55

Open
i-am-the-slime opened this issue Jul 31, 2020 · 2 comments
Open

-f removes exports used by other exports #55

i-am-the-slime opened this issue Jul 31, 2020 · 2 comments

Comments

@i-am-the-slime
Copy link
Contributor

i-am-the-slime commented Jul 31, 2020

This might actually be intentional and we will need to update the FFI in the "offending" module. I'm using react-basic-hooks.
And that has code like this:

exports.useEffect_ = function (eq, deps, effect) {
  var memoizedKey = exports.useMemo_(eq, deps);
  React.useEffect(effect, [memoizedKey]);
};

I don't use useMemo_ (in fact I can't since it's not exported) but I use useEffect which in turn uses useEffect_ which then can't find useMemo_.

Would you say this is a bug or should the FFI be rewritten in a way that avoids this?

Edit: Yeah I just had a look at dce-output and that's what's happening. I will try to rewrite the FFI.

@coot
Copy link
Collaborator

coot commented Jul 31, 2020

I'd say it's a bug. Would this reproduce the issue:

exports.a = exports.b
exports.b = 1

Even though a is referenced by a PureScript module, b is not preserved. Do I got it right?

@coot
Copy link
Collaborator

coot commented Aug 11, 2020

My example did not reproduced the problem, do you happen to have a small example that illustrates the problem?

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

2 participants