Skip to content

Rewriting CommonJS foreign modules of core/contrib/web libraries #1

Open
@i-am-the-slime

Description

@i-am-the-slime

Originally written by @thomashoneyman

Rewriting CommonJS foreign modules is straightforward but the exact format into which we should rewrite them depends on what we do with purs bundle.

If we were to drop our bundler we could rewrite exports.ƒ = function () { to export const ƒ = function () { (as @i-am-the-slime started to do in purescript/purescript-prelude#264) or export function ƒ() {.

But if we are to keep our bundler we could rewrite this to export function ƒ() { -- only once purescript/purescript#4044 is merged -- and other declarations should be exported as vars (unless we extend the bundler to support lets, consts and other declarations).

As I said earlier, I think it's really unlikely anything happens to the bundler in the near future, so the second option is the one that's probably the way forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions