matthewmueller / joy

A delightful Go to Javascript compiler (ON HOLD)
https://mat.tm/joy
GNU General Public License v3.0
1.32k stars 35 forks source link

imports should add $ in front to avoid collision #50

Open matthewmueller opened 7 years ago

matthewmueller commented 7 years ago
var header = pkg['github.com/matthewmueller/golly/testdata/49-jsx/header']

to:

var $header = pkg['github.com/matthewmueller/golly/testdata/49-jsx/header']

in:

pkg['github.com/matthewmueller/golly/testdata/49-jsx'] = (function() {
  var h2 = pkg['github.com/matthewmueller/golly/testdata/49-jsx/h2']
  var header = pkg['github.com/matthewmueller/golly/testdata/49-jsx/header']
  var jsx = pkg['github.com/matthewmueller/golly/testdata/49-jsx/jsx']
  var text = pkg['github.com/matthewmueller/golly/testdata/49-jsx/text']
  function main() {
    var header = h(
      h2.H2,
      {
        class: 'hi'
      },
      [
        'yo!',
        h(
          header.Header,
          {
            Title: 'lol'
          },
          ['hi!']
        )
      ]
    )
    console.log(header.Render().String())
  }
  return {
    main: main
  }
})()