Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

have babel transpile and use babili to minify#6

Merged
selfup merged 6 commits intomasterfrom
minify-babel
Feb 9, 2017
Merged

have babel transpile and use babili to minify#6
selfup merged 6 commits intomasterfrom
minify-babel

Conversation

@selfup
Copy link
Copy Markdown
Owner

@selfup selfup commented Feb 9, 2017

@jbucaran This will minify the code as well as transpile it 😄 when doing npm run build

🎉

@selfup
Copy link
Copy Markdown
Owner Author

selfup commented Feb 9, 2017

For the built bundle.js

Before

screen shot 2017-02-09 at 1 47 02 am

After

screen shot 2017-02-09 at 1 50 00 am

It's really only one line, but the template sting is 21 lines so 22 lines haha 😂

closes #2

@jorgebucaran
Copy link
Copy Markdown
Contributor

jorgebucaran commented Feb 9, 2017

Yeah, it should be less after stripping hyperx.

For JSX support you'll want to include the pragma in the .babelrc file.

{
  "plugins": [
    ["transform-react-jsx", { "pragma":"h" }]
  ]
}

@selfup selfup mentioned this pull request Feb 9, 2017
@selfup
Copy link
Copy Markdown
Owner Author

selfup commented Feb 9, 2017

Ok then i might keep this repo focused on the template strings then. Might need your help with stripping hyperx to do the transform 😄

@jorgebucaran
Copy link
Copy Markdown
Contributor

@selfup Either is fine. If you are going to include a .babelrc, might as well add the pragma also, what do you think?

@selfup
Copy link
Copy Markdown
Owner Author

selfup commented Feb 9, 2017

Sure I will take a look tomorrow. Thanks for the pointers so far!

@selfup
Copy link
Copy Markdown
Owner Author

selfup commented Feb 9, 2017

Ok couldn't sleep haha

I also added JSX support (I tried, it works on 0.0.12)

Will keep it on 0.0.9 for now until 0.0.13 reintroduces the const { html } = require('hyperapp')

Once that is out, I will put a JSX translation of the only view to copy/paste so that developers can just get started real fast!

Keeping the template literals since that follows the current spirit of the project.

This also ensures that in dev mode we don't have minified code 😄

@jorgebucaran
Copy link
Copy Markdown
Contributor

jorgebucaran commented Feb 9, 2017

The current, soon to be gone, "hyperapp/hx" is only for Hyperx, so you should be able to use "hyperapp" already if you are using JSX.

Will release 0.0.13 in a short while.

@selfup
Copy link
Copy Markdown
Owner Author

selfup commented Feb 9, 2017

Thanks again for all the feedback

I'll go ahead and merge this tomorrow once I have had some sleep!


Let me know if you don't mind me using JSX as the base example for this repo 😄

@jorgebucaran
Copy link
Copy Markdown
Contributor

Let me know if you don't mind me using JSX as the base example for this repo 😄

Of course not! Users should use whatever they find more convenient and my preferences should not get in the way! Go jsx! haha

@selfup selfup merged commit a7a19de into master Feb 9, 2017
@selfup selfup deleted the minify-babel branch February 10, 2017 07:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants