hugo/docs/content/en/news/0.74.0-relnotes/index.md
2020-07-20 22:20:33 +02:00

7.8 KiB


date: 2020-07-13 title: "Native JS Bundler, Open API Support, Inline Partials" description: "Hugo 0.74.0 brings blazingly fast native JavaScript bundling, with minification, tree shaking, scope hoisting for ES6 modules, and transpilation of JSX and newer JS syntax down to ES6. And more." categories: ["Releases"]

Note: The documentation site isn't updated with all of the main new things below. We will get to it soon. See https://github.com/gohugoio/hugoDocs/issues/1171

This release comes with native JavaScript bundling (and minifier), with import support (from node_modules etc.), tree shaking, scope hoisting for ES6 modules, transpilation of JSX and newer JS syntax down to ES6, JavaScript/JSX and TypeScript/TSX support. And it's very fast. Benchmarks rates it at least 100x faster than the other JavaScript bundlers included. This new feature is backed by the very impressive ESBuild project by @evanw. Many thanks to @remko for the integration work.

A very simple example building a TypeScript file:

{{ $js := resources.Get "js/main.ts" | js.Build }}

This release also comes with Open API 3-support. This makes it much easier to create "Swagger styled" API-documentation. The below will unmarshal your YAML file into this object graph:

{{ $api := resources.Get "api/openapi.yaml" | openapi3.Unmarshal }}

Hugo's Asciidoc integration has also gotten a face lift. A big shoutout to @muenchhausen and @bwklein for their work on this.

And finally, partials can now be defined inline -- and that is way more useful than it sounds.

This release represents 23 contributions by 9 contributors to the main Hugo code base. @bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @niklasfasching, @bwklein, and @muenchhausen for their ongoing contributions.

And a big thanks to @digitalcraftsman for his relentless work on keeping the themes site in pristine condition and to @davidsneighbour, @coliff and @kaushalmodi for all the great work on the documentation site.

Many have also been busy writing and fixing the documentation in hugoDocs, which has received 8 contributions by 7 contributors. A special thanks to @OmarEmaraDev, @regisphilibert, @coliff, and @jessicahuynh for their work on the documentation site.

Hugo now has:

Enhancements

Templates

Output

Core

Other

Fixes

Other