Closed robjtede closed 2 years ago
Thank you for your PR! Right now I’m not sure I’d accept this as is, however I think there’s solution in fluent-templates
.
but given that flume is not adding any value where it is used here, it seems prudent to reduce dependencies, too.
This is not true, flume is measurably significantly faster than std’s channel implementation, you will notice it, especially in large directories.
It’s a shame that nanorand doesn’t guard the cfg, which should be fixed, but the read_from_dir
code will not work in a WASM environment anyway, so if instead of removing flume
, could you just cfg out the filesystem code for WASM environments? That would be acceptable to me. You also then don’t need to change fluent-template-macros
, since it always runs on the host.
Fair enough that you know about the performance impacts. Removing default features also breaks the cycle so opted for that.
It’s a shame that nanorand doesn’t guard the cfg
It does on it's master branch but sadly that's not released yet.
Completed the example BTW: https://github.com/actix/examples/tree/master/templating/fluent. Really liking this lib.
Any thoughts on this solution?
Oh sorry, I thought I had already merged this. Thank you for your PR, and congrats on your first contribution! 🎉
For some annoying reasons that have nothing to do with the quality of this lib, having flume as a dependency is preventing some compilations. This PR removes the default features to make sure
nanorand
doesn't get included.The real culprit is that
nanorand
v0.7.0 doesn't guard itsjs
feature with anycfg
, which when used by flume (default features) results in a nasty circular dependency such as:This seems like the simplest solution for my immediate issue (trying to add a fluent templates example to the Actix Web examples repo) but given that flume is not adding any value where it is used here, it seems prudent to reduce dependencies, too.