You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm intending to publish pug 3.0.0 within the next 24 hours. In the mean time, it would be great if as many people as possible could try out the "canary" build. You can get it by running npm install pug@canary.
I've automated the release process via Rolling Versions so it will now always be possible to install the version currently on the master branch via pug@canary, and new production-ready releases should be much more frequent.
The provisional release notes for pug@3.0.0 are as follows:
If you don't wish to support this advanced use case, you can continue returning string. If you did not provide a read plugin, you do not need to do anything.
This requires an environment that supports the for (const val of iterable) syntax in JS. You can iterate over Maps, Sets etc. as well as arrays. There is also some destructuring of map keys:
- constmap=newMap([['a', 'x'], ['b', 'y']]);each [key, value] of map
li
strong= key= value
// options.jsexports.filters={png: {// instead of a function, specify an object with a "renderBuffer" property// whose value is a function that takes a Buffer instead of a stringrenderBuffer: function(buffer,options){vardata=Buffer.from(buffer).toString('base64');return'<img src="data:image/png;base64, '+data+'"/>';}}};
You can then use the filter like:
// foo.pug
include:png my-small-image.png
The text was updated successfully, but these errors were encountered:
I'm intending to publish pug 3.0.0 within the next 24 hours. In the mean time, it would be great if as many people as possible could try out the "canary" build. You can get it by running
npm install pug@canary
.I've automated the release process via Rolling Versions so it will now always be possible to install the version currently on the master branch via
pug@canary
, and new production-ready releases should be much more frequent.The provisional release notes for pug@3.0.0 are as follows:
Breaking Changes
The minify option on filters now requires you to install the relevant jstransformer (suport minify option in filter using jstransformer #3084)
Currently we support:
read plugins must now return Buffer if you want to support filters that use renderBuffer (Allow filters to read non-text include files #3213)
If you don't wish to support this advanced use case, you can continue returning string. If you did not provide a read plugin, you do not need to do anything.
Drop support for node 6 and 8 (chore: remove lerna as yarn supports enough stuff now #3243)
Features
Add support for replacing code gen via a plugin with generateCode (Add the possibility of replacing generateCode function #3230)
Support each ... of ... loops (Adding 'each .. of' syntax #3179)
This requires an environment that supports the for (const val of iterable) syntax in JS. You can iterate over Maps, Sets etc. as well as arrays. There is also some destructuring of map keys:
Support filters that apply to Buffers (Allow filters to read non-text include files #3213)
e.g.
You can then use the filter like:
// foo.pug include:png my-small-image.png
The text was updated successfully, but these errors were encountered: