myitcv / gopherjs

A compiler from Go to JavaScript for running Go code in a browser
BSD 2-Clause "Simplified" License
21 stars 0 forks source link

compiler/prelude: move prelude to separate .js files #3

Closed myitcv closed 6 years ago

myitcv commented 6 years ago

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.