Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Shim Javascript Code #111

Copy link
Copy link
Closed
Closed
Copy link
@ajhager

Description

@ajhager
Issue body actions

I keep having the need to provide custom javascript with a GopherJS library. For something like AngularJS, it seems fair to ask a user to include the library manually, but with custom library code it becomes a chore.

I created a utility to get around this https://github.com/ajhager/shmi, but it adds a manual build step. I wonder if it would be helpful to provide a mechanism to bundle javascript automatically using GopherJS.

There are a few ways this could be handled, but I suggest perhaps:

import "github.com/gopherjs/gopherjs/js"

js.Provide("./myjscode.js")
// OR
js.Import("./myjscode.js")
// OR
js.Bundle("./myjscode.js")

The compiler could make sure any javascript files would only be bundled once, and raise an error if the files don't exist.

I am happy to work on this, but I would appreciate some feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.