node-stow icon indicating copy to clipboard operation
node-stow copied to clipboard

Update node, redis lib; deprecate hydration lib

Open Qulinary opened this issue 10 years ago • 8 comments

Hey! Awesome lib. We made a few tweaks to get this working on more modern versions of node. Build is happily passing:

https://travis-ci.org/QulinaryOrg/node-stow

Qulinary avatar Oct 13 '15 17:10 Qulinary

Hey, thanks for the PR! Glad to know someone else is getting some good use out of stow, it's been successfully humming along for us for years.

The one thing blocking me from immediately merging this is the deprecation on hydration. This would be a huge breaking change for anyone (possibly me) relying on proper serialization of Date and RegExp objects. At best this would be a divergence from the current API and a Major version update, at worst a deal-breaker.

I wonder if there is a more up-to-date serialization approach that supports native JS types or if we can get hydration updated so we can still use it.

@carlos8f

cpsubrian avatar Oct 13 '15 17:10 cpsubrian

Also probably worth removing the engines field altogether and making sure it runs on node 4.x also (sinces that's the new stable build).

cpsubrian avatar Oct 13 '15 18:10 cpsubrian

Note: I'm fine with the switch to plain redis, since this already supports client which could be an haredis client anyhow.

cpsubrian avatar Oct 13 '15 18:10 cpsubrian

Great, thanks for quick comments, @cpsubrian Do you have a test case (or high-level description ... I can write the test) of what is needed regarding serialization support? The changes didn't fail any existing test cases, hence didn't think it was a breaking change.

matmar10 avatar Oct 13 '15 18:10 matmar10

This looks promising: https://github.com/skeeto/resurrect-js

matmar10 avatar Oct 13 '15 18:10 matmar10

Yeah this is a case where there were implied requirements not in the tests, my bad! I think we'd want to add a test with a cached object that has Date and RegExp objects in them and make sure that when they are retrieved from the cache they are re-instantiated properly. Of note is the fact that hydration is recursive, so a Date 4 levels deep in an object will still be properly handled.

Agreed that resurrect looks promising.

cpsubrian avatar Oct 13 '15 18:10 cpsubrian

Also, I'm giving you commit access here, but I'd still like to discuss changes in the form of PRs.

cpsubrian avatar Oct 13 '15 18:10 cpsubrian

Why this pull request was abandoned?

gustawdaniel avatar Dec 12 '20 17:12 gustawdaniel