-
Notifications
You must be signed in to change notification settings - Fork 570
compiler/prelude: move prelude to separate .js files #791
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
Conversation
22e0772
to
dcfaa84
Compare
@hajimehoshi @shurcooL - yes, #791 (this PR) is ready for review. It's fully rebased on top of the most recent changes in #784. As I mentioned in #793 we need to make a decision on whether we merge:
or something else. |
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
db1b319
to
282938b
Compare
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
This has now been rebased against |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
I've been working with the prelude quite a lot recently. One of the really painful things with the current implementation is that the JavaScript for the prelude exists as a const string in a .go file, which makes properly writing and formatting the JavaScript itself very difficult. This PR splits the prelude into separate .js files to make editing the JavaScript prelude more straightforward. genmin.go becomes genprelude.go where these .js files are catted together into a single prelude.go file. The minified prelude_min.go is as before. Automated formatting of these .js files will follow in a later PR.
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
This PR introduces automatic formatting of the prelude's now separate .js files. Using prettier has the same argument as using gofmt on .go source code. As part of this we make the go generate step for the prelude include a formatpreludejs.go step. The resulting prelude_min.go file is slightly different now, but post gopherjs#791 we can see these differences are entirely and solely attributable to prettier's adjusting of the .js files.
Is this still relevant? Will it remain relevant if we switch to Go 1.16's use of Thoughts @nevkontakte ? |
As this PR is no longer mergable, and will need to effectively be done from scratch, I'm going to close it. Further, @nevkontakte and I have discussed this, and he has some good ideas on improving the prelude handling which will render this PR obsolete, so he'll soon file a new issue to track progress on this front. |
I've been working with the prelude quite a lot recently. One of the really painful things with the current implementation is that the JavaScript for the prelude exists as a
const
string in a.go
file, which makes properly writing and formatting the Javascript itself very difficult.This PR splits the prelude into separate
.js
files therefore and adds aformatpreludejs.go
go generate
-er to format those.js
files in place.