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:
- 45377+ stars
- 438+ contributors
- 331+ themes
Enhancements
Templates
Output
Core
Other
- Regenerate docs helper 25e3da33 @bep
- Add js.Build asset bundling 2fc33807 @remko #7321
- Add openapi3.Unmarshal 12a65e76 @bep #7442#7443
- Remove trailing hyphen from auto heading ID 58c0f5e6 @jmooring #6798
- Ensure that non-trivial default flag values are passed through. a1c3e3c1 @vangent
- Update formats.md doc for new allowed extensions. e9f87c4e @bwklein
- Update config.go to add two Asciidoctor extensions beb6c03b @bwklein
- Add support for inline partials 4a3efea7 @bep #7444
- Add support for native Org dates in frontmatter c66dc6c7 @sometimesfood
- Update go-org to v1.3.0 127d5feb @niklasfasching
- Update go-org to v1.2.0 2d42ba91 @niklasfasching
- Update bug_report.md 5b7b5dea @bep
- Remove some unused code 057b1377 @bep
- Add an option to print memory usage at intervals 48dbb593 @bep
- Rework external asciidoctor integration f0266e2e @muenchhausen
- Enable the embedded template test when race detector is off 77aa385b @bep #5926
- Merge branch 'release-0.73.0' 545a1c1c @bep
- Updated installation instruction about Sass/SCSS support 0b579db8 @mateusz-szczyrzyca