Skip to content

compiler/prelude: format .js files using prettier #794

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

Closed
wants to merge 2 commits into from

Conversation

myitcv
Copy link
Member

@myitcv myitcv commented Apr 18, 2018

DO NOT MERGE

Based on #791 - this will need a rebase once #791 is merged.

See the diff this PR introduces on top of #791 here

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
#791 we can see these
differences are entirely and solely attributable to prettier's adjusting
of the .js files.

@myitcv myitcv force-pushed the prettier_js branch 4 times, most recently from 9b39c2e to 376ff32 Compare April 22, 2018 18:05
myitcv added 2 commits May 4, 2018 20:36
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.
@flimzy
Copy link
Member

flimzy commented Dec 28, 2021

See #791 (comment) for the future plans on this issue.

@flimzy flimzy closed this Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants