Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metalsmith 3.0 Roadmap #353

Open
2 of 7 tasks
webketje opened this issue Dec 6, 2021 · 0 comments
Open
2 of 7 tasks

Metalsmith 3.0 Roadmap #353

webketje opened this issue Dec 6, 2021 · 0 comments

Comments

@webketje
Copy link
Member

webketje commented Dec 6, 2021

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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant