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
This issue is meant to group & provide an overview of what features will be in release 3.0
Use Node streams to read & write files + benchmark
Allow destructuring Metalsmith methods, e.g. const { use, clean, build } = new Metalsmith()
Make inner variables (_source, _metadata, _directory etc) truly inaccessible using symbols or a factory closure (TBD)
Remove the unyield dependency & rewrite all methods using them to return promises (done in 2.5), TBD if callback support should be fully removed
Remove the co-fs-extra dependency & rewrite all methods using it to use native NodeJS API's (done in 2.5)
Reading files into memory buffers that are intended only for copying over to a destination directory (static assets) can incur significant overhead. Introduce a method (Metalsmith#static/copy('favicon.ico', 'assets/**')?) that uses the NodeJS copyFile method that is more efficient than readFile then writeFile.
There's a lot of discussion about getting the "final" filepath of a metalsmith file for rendering with layouts (see Metalsmith and Filenames, What can we do to improve them? #58). To be evaluated whether this could be solved by making the file objects actual instances of a File or FileObject constructor that knows a reference to its parent object and has a getter/setter that finds a reference to itself like Object.keys(files).find(key => files[key] === this). Bonus is better type-hinting. Issues are: what if the file object is cloned to a different path? how to handle dynamically injected prototype-less files by plugins?
The text was updated successfully, but these errors were encountered:
This issue is meant to group & provide an overview of what features will be in release 3.0
const { use, clean, build } = new Metalsmith()
_source, _metadata, _directory
etc) truly inaccessible using symbols or a factory closure (TBD)Remove the(done in 2.5), TBD if callback support should be fully removedunyield
dependency & rewrite all methods using them to return promisesRemove the(done in 2.5)co-fs-extra
dependency & rewrite all methods using it to use native NodeJS API'sMetalsmith#static/copy('favicon.ico', 'assets/**')
?) that uses the NodeJScopyFile
method that is more efficient than readFile then writeFile.File
orFileObject
constructor that knows a reference to its parent object and has a getter/setter that finds a reference to itself likeObject.keys(files).find(key => files[key] === this)
. Bonus is better type-hinting. Issues are: what if the file object is cloned to a different path? how to handle dynamically injected prototype-less files by plugins?The text was updated successfully, but these errors were encountered: