-
Notifications
You must be signed in to change notification settings - Fork 570
gopherjs test
does not include *.inc.js files.
#306
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
Comments
I don't see why not. In fact, I would be inclined to think the only reason it's not already the case is because of a bug or unintended omission. Unless I'm missing something and there was a reason this That said, this is another feature I do not plan to use much myself, if at all. But if others want to, I think they should be able to. It should probably not be recommended unless appropriate for the situation. |
Now that I think about it more, it might be on purpose. Adding additional JavaScript makes sense when building the final output, such as the case for a So, I probably take back what I said above. |
Yes, that's true. For it to really work well, it would almost certainly have to be in some sort of a CommonJS-style closure. And trying to mix that with GopherJS doesn't sound fun. |
(Oops, didn't mean to close it just yet... although that's probably going to be the eventual fate of this anyway). |
I think it's reasonable to make it work with all packages. I don't know why it currently does not work, it was not on purpose. @flimzy Would you like to dig into that or should I take a look? |
I'll take a crack at it. What are your thoughts on @shurcooL's point about conflicts? I suppose just trust users not to let that happen? |
Yeah, bad things can be done in a lot of ways. This however does not seem like an explicit invitation to do so. ;-) |
My investigation has lead me to the conclusion that the failure I observed is not specifically with non-main packages, but rather that This also lead me to discover that
But doing this with
It appears that I'm willing to continue working toward a fix, but I think I need some guideance from you, @neelance, as to what the intended behavior for |
gopherjs test
does not include *.inc.js files.
Just want to confirm, do you mean that doing |
That is correct. That is my observation. |
I'm testing with this repo: https://github.com/flimzy/jstest If I do
|
I've been distracted the last several weeks by an international move. I'll finish investigating my fix in #322 over the next few days as time permits. |
Resolved with #322. |
Remove work-around for bug gopherjs/gopherjs#306
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 themain
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 (aneval()
, triggers warnings in browsers with CSP enabled). So I was looking at including a simplejsbuiltin.inc.js
that contained simplyfunction typeoffunc(x) { return typeof x }
. But, since this is thejsbuiltin
package, and notmain
, 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.The text was updated successfully, but these errors were encountered: