Description
The following description is inaccurate. Jump to here to see a proper explanation of the issue.
I don't know if this is a good idea, but I want to propose it for discussion, because it seems, at least at first glance, that it could make a few things easier for me.
I've read through issue #111 and the related commits. It appears (from reading 51e33b7, as well as the observed behavior in testing) that this feature is only applicable when compiling the main
package.
Would it be reasonable to do the same for library packages?
At present I'm looking at this in respect to gopherjs/jsbuiltin#2. The current solution I'm using there (an eval()
, triggers warnings in browsers with CSP enabled). So I was looking at including a simple jsbuiltin.inc.js
that contained simply function typeoffunc(x) { return typeof x }
. But, since this is the jsbuiltin
package, and not main
, that feature isn't enabled.
I can also see some potential benefits when writing wrappers/bindings for existing JavaScript functions--it might be handy (if/when licensing permits) to include the relevant JavaScript code in the bundled Go package.
I haven't thought this through entirely. I'm not 100% convinced it's all a good idea... But I imagine you guys have thought about many more of the underlying implications than I have to know if this is a good idea or not.