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

Use new JS backend syntax in js_send foreign import #105

Merged
merged 3 commits into from
May 6, 2024

Conversation

sevanspowell
Copy link
Contributor

I believe that some foreign imports haven't been updated to use the new GHC JS backend syntax.

I needed to make this change to get servant-jsaddle to work.

Have I done the correct thing here? I'm particularly dubious about replacing the $c argument with a named variable c.

If this is correct, I can make these changes throughout the codebase.

@sevanspowell
Copy link
Contributor Author

Related to ghcjs/ghcjs-base#136

@hsyl20
Copy link
Contributor

hsyl20 commented May 6, 2024

I'm particularly dubious about replacing the $c argument with a named variable c.

The name of the variable doesn't matter. But yes interruptible FFI functions take an additional continuation argument. See

function h$dom$sendXHR(xhr, d, cont) {

@sevanspowell
Copy link
Contributor Author

Thanks @hsyl20, this is the kind of feedback I need. I'll test that the suggestion works locally and post back here.

@sevanspowell
Copy link
Contributor Author

sevanspowell commented May 6, 2024

I tested it locally with an xhr request and there was no issues 👍

@hsyl20 hsyl20 merged commit 9b4b41a into ghcjs:master May 6, 2024
hamishmack added a commit that referenced this pull request May 7, 2024
PR #105 relaxed the `ghcjs-base` bound on `ghcjs-dom-jsffi`, but the fix was for `ghcjs-dom-javascript`.  We should not be using both `ghcjs-dom-jsffi` and `ghcjs-dom-javascript` at the same time.

Packages should either depend on `ghcjs-dom` only (and let it choose the correct implementation library) or do something like:

```
if impl(ghc >9)
  build-depends: ghcjs-dom-javascript
else
  build-depends: ghcjs-dom-jsffi
```
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