Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 17 17:23
    Ecco commented #1449
  • Nov 17 17:22
    Ecco commented #1449
  • Nov 17 10:41

    ddfreyne on nanoc-live-warning

    (compare)

  • Nov 17 10:41

    ddfreyne on master

    Warn when both guard-nanoc and … Merge pull request #1468 from n… (compare)

  • Nov 17 10:41
    ddfreyne closed #1468
  • Nov 17 10:41
    ddfreyne closed #1450
  • Nov 17 10:37
    ddfreyne synchronize #1468
  • Nov 17 10:37

    ddfreyne on nanoc-live-warning

    Warn when both guard-nanoc and … (compare)

  • Nov 17 10:33

    ddfreyne on master

    Use zero wait_for_delay With w… (compare)

  • Nov 17 10:31
    ddfreyne commented #1450
  • Nov 17 10:30
    ddfreyne commented #1450
  • Nov 17 10:30
    ddfreyne commented #1450
  • Nov 17 10:17
    ddfreyne labeled #1468
  • Nov 17 10:17
    ddfreyne opened #1468
  • Nov 17 10:16

    ddfreyne on nanoc-live-warning

    Warn when both guard-nanoc and … (compare)

  • Nov 17 10:04
    ddfreyne commented #1449
  • Nov 17 09:56

    ddfreyne on master

    Use non-zero latency and wait_f… (compare)

  • Nov 17 09:38

    ddfreyne on master

    Refactor: Remove unused Pathnam… (compare)

  • Nov 17 09:31

    ddfreyne on master

    Refactor: Move RuleDSL errors i… (compare)

  • Nov 17 09:25

    ddfreyne on master

    Refactor: Remove unused NoMatch… (compare)

Denis Defreyne
@ddfreyne
For compileable items?
Do you mean textual, or binary?
Andri Möll
@moll
Presumably anything that's not identical to content, but particularly text files.
Denis Defreyne
@ddfreyne
I think what surprises me is that the DELETE + CREATE + MODIFY happens slow enough that the browser actually sees the file as missing
Andri Möll
@moll
It seems there's a pretty good opportunity for optimizing "compilation" of passed through binary items, too — not to compare them byte by byte with FileUtils.identical, but check if they're hard links. If I change the hard linked file in content, it's guaranteed to already match in output.
Yeah, I'm seeing it approximately every 10 updates. Fast computer, what can I say. :P
Denis Defreyne
@ddfreyne
Also makes me wonder whether Nanoc could create a hard link temporarily in ./tmp/nanoc (inside the site dir) and then move it in place (which would be atomic)…
Andri Möll
@moll
Still, how does a hard link help there?
There's one index.html compiled to /tmp. That's not around after the compile ends. Why not move it immediately?
Denis Defreyne
@ddfreyne
nanoc/nanoc#1321 Here’s the MR that introduced hard links
Andri Möll
@moll
I find his hard linking proposal to be sensible for files that are identical. For the changed items, I'm still puzzled.
Identical between content and output, that is.
Even the copy fallback seems wasteful if I understand the flow correctly. Given a compiled file (like Markdown -> HTML) temp_path referes to a file that's deleted after the method finishes. That file shouldn't be copied and then deleted, it should only be moved.
Denis Defreyne
@ddfreyne
I will have to give this a bit more thought, but I believe you are right
(Though if hardlinking fails, mv will likely be equivalent to a cp + rm anyway)
Andri Möll
@moll
For files on different filesystems, yep. However, as I currently understand it, a move itself (a.k.a rename), can be atomic while a hard link perhaps can't be.
Denis Defreyne
@ddfreyne
It looks like it!
Though for your particular problem, perhaps a 100ms delay somewhere would be enough
I am not sure how to introduce that, however.
Andri Möll
@moll
LiveReload does have a delay option (which Adsf sets to 0), but I can probably wait for the correct solution, too. :)
Denis Defreyne
@ddfreyne
adsf could definitely set it to something else (0.1 maybe)
Andri Möll
@moll
Perhaps making it configurable would be best.
Denis Defreyne
@ddfreyne
I’d suggest against that; if it turns out that configurability is needed because 0.1 does not work for everyone, we can revisit that
(Otherwise, you end up with something that is so configurable that the config file becomes overwhelming)
Andri Möll
@moll
If it's only to bounce back a delete-and-create, you could then go with 50ms probably, too.
I've used LiveReload generally for a long time and I remember it requiring quite a bit of tweaking to find the sweet spot for each project — sometimes compiling JavaScripts or CSS to the output directory took a long time and having the browser constantly reload during that time was annoying. :P
Ideally Nanoc should signal a reload only once it has actually finished its compile cycle.
But with LiveReload being part of adsf instead of Nanoc, that may be more difficult practice than in theory.
Denis Defreyne
@ddfreyne
Hm yeah, good point… that’d be good to have
Denis Defreyne
@ddfreyne
@moll If you’re willing to add support for that to adsf, I’d be happy to help!
Andri Möll
@moll
I'm totally willing in principle, but unfortunately given how long my own OSS backlog is, it's unlikely I'll get to it soon. :innocent: I think I've got PRs on some projects open for a couple of years now. :P
I got my personal Nanoc powered site up a few weeks ago, too, and am trying to write for it. Took me only about 6 years I think. :P
Nanoc's been around for quite some time, hasn't it. :)
Thanks for still maintaining it!
Denis Defreyne
@ddfreyne
Haha :)
12.5 years now…
Predates RSpec 1.0, the iPad, Pluto being a planet, Obama becoming president, etc. It’s ancient
Andri Möll
@moll
Uh-oh, that means it took me longer to get my site up, too. :P I remember I've had two "coming soon" style personal sites before this final one.
Denis Defreyne
@ddfreyne
My site (https://denis.ws/) is now so simple that I could probably whip up something far simpler than Nanoc to maintain it, haha
Andri Möll
@moll
2010 is my earliest commit.
Haa, it is. You could've done that with... React. React with isomorphic server side rendering and three megs of client side JavaScript.
Denis Defreyne
@ddfreyne
I like React and I’d love to use its concept of components more, throughout all the sites I create.
I’ve been thinking about what Nanoc-with-components could look like — it’d probably involve revamping the rendering helper significantly.
Andri Möll
@moll
I just use JSX in JavaScript because it's lintable via ESLint, but don't use React. I use JSX on the server side with a few dozen lines to render HTML directly with https://github.com/moll/js-j6pack/. Works far better than the nonsense that is React on the server side.
Denis Defreyne
@ddfreyne
Oh nice — I really like that
Anyway, sleep time!
Andri Möll
@moll
Here's an Estonian site built in that fashion should you want a real life example: https://github.com/rahvaalgatus/rahvaalgatus. The JSX is in views, e.g. https://github.com/rahvaalgatus/rahvaalgatus/blob/master/views/error_page.jsx.
Nightie!
giodestone
@giodestone

should the has_key?("key") work for items in layouts? i.e. @item.has_key?("useImageCarousel") gives me NoMethodError: undefined method `has_key?' for <Nanoc::CompilationItemView identifier=/article-index.html>:Nanoc::CompilationItemView

If it helps its inside of a layout

giodestone
@giodestone
Nevermind, replacing has_key?() with key?() worked...