purescript / purescript-prelude

The PureScript Prelude
BSD 3-Clause "New" or "Revised" License
163 stars 88 forks source link

Migrate FFI to ES modules #287

Closed JordanMartinez closed 2 years ago

JordanMartinez commented 2 years ago

Description of the change

Backlinking to purescript/purescript#4244

Migrates FFI to ES modules. This continues what was started in #284 but using a different branch named es-modules-libraries to ensure further development on the compiler isn't affected by commits pushed to this PR.

This PR also succeeds #264 since that PR was not opened by the 'working-group-purescript-es' org, which allows multiple people to push to the PR if the original submitter is gone for while.

This PR will fail to build until pulp has been updated to support ES modules when one calls pulp run and pulp test. See https://github.com/purescript-contrib/pulp/issues/400 for more info.


Checklist:

JordanMartinez commented 2 years ago

PRs to pulp to support ES modules are ready for review:

JordanMartinez commented 2 years ago

CI builds now :tada:

JordanMartinez commented 2 years ago

The alpha-02 release is now on GH. Restarting CI to verify this PR still builds.

JordanMartinez commented 2 years ago

CI builds on the alpha-02 release.

thomashoneyman commented 2 years ago

We need to be careful that setup-purescript has auto-updated to the latest unstable release before re-running CI. For example, it's still on alpha-01:

https://github.com/purescript-contrib/setup-purescript/blob/81d7c48c3f39de23dcd3626ab216699010200db2/dist/versions-v2.json#L2-L4

and so that re-run of CI pulled in the old purs:

Cached path /opt/hostedtoolcache/purs/0.15.0-alpha-01/x64, adding to PATH

I've restarted the sync versions job there so that it updates the file and then we can re-run CI here.

JordanMartinez commented 2 years ago

Ah, good catch.

thomashoneyman commented 2 years ago

This looks good to me other than the discussion around the eslint configuration.

thomashoneyman commented 2 years ago

@JordanMartinez Is it acceptable to delete the es-modules-libraries branch, or does it need to be kept around for the sake of upstream packages?

JordanMartinez commented 2 years ago

The working-group-purescript-es/package-set#main should be using the es-modules branch still, but pulp@16.0.0-0 would still try to install the branch via pulp ini. So, perhaps we should hold off until a pulp@16.0.0-1 can be released that just installs master from the core repo, not the es-modules-libraries branch from the working group repo?