We're currently not using pathval and the code on the pathval github repo is quite old. It would be good to make the effort to move the pathval code which resided in chai (here, here and here) into the pathval module.
Pathval module itself should also be updated to the same standards type-detect and check-error are - so using the same build, lint, code coverage, and browser testing tools.
Well, if there isn't anyone doing this I'd be happy to help with this issue. Since I've done the check-error repo I think I'm pretty familiar with the whole process.
Would you mind if I do so, @keithamus and @meeber?
I'm happy if @meeber's happy 馃槃
Have at it!
Thanks guys, I'm going to have a lot of fun with this on this weekend :smile:
Hello folks, I'd like to update you on the status of this issue and also ask some questions.
Currently I've moved the whole code to the pathval repo and the project structure is also done. All that's left is the tests to get 100% coverage, and the rest depends on your answers to the questions below:
pathval? I think it would be a nice thing to do, but I'm not sure this fits into the scope since it can generate new bugs or unexpected behavior. Should I do it or not?pathval'sset method, but it seems like an important method for pathval as a standalone method, so I thought it would be nice to keep it, what do you think about it?.eslintrc rules a little bit? Some rules are too strict, such as making initializing a variable mandatory (even though I want it to really be undefined) and not allowing only if/else branches inside an else block. Currently there is no elegant way to make pathval work with these rules, so instead of using eslint-disable-line I would prefer disabling these rules at all.Well, I think that's all, thanks for you attention :smile:
4.0 so if it breaks compat its not the biggest problem..set - part of the reason of splitting these libs out is to make them independently useful. init-declarations and no-lonely-if so let me give my justifications for them:null, that's what null is there for, null also gives the consumers of your API a result which has a clear and explicit intention. null always means return null (or return someValueThatIsNull), undefined means that either the function exited without returning, it returned nothing (return), return undefined (explicit), return someValueThatNeverGotAssigned, return someValueThatWasExplicityAssignedToUndefined, return void... the list goes on. The point being, undefined is a "bad part" of JavaScript.else altogether because reading code that just has a set of ifs makes things much more readable - ifs are context free, whereas else says "all of the context a dozen lines above me, yeah - not that".I've been meaning to write a set of proper documents about the justification for each rule in that strict config - but I stand by each one of them as valid rules. I want to make sure we are all able to write awesome code though - so if you feel strongly about removing them, let's look into that.
@keithamus Thanks for the explanation! Well, since I'll rewrite the code I think those rules won't be much of a problem, however, thanks for the detailed explanation on the reason for them.
IMO the no-lonely-if really makes sense and I think you're completely right.
I was worried about init-declarations because of compatibility, I would prefer returning null too, but I was worried if we should keep the exact same behavior pathval had before or not (and by pathval I mean the parts of it inside Chai's core too), so returning null definitely solves the problem with this rule too.
Thanks again, Keith :smile:
Speaking of linting... Chai core needs it badly. I'd like to make it a priority after v4 is released.
Speaking of v4 release... How do we want to approach merging the 4.x.x branch? I imagine it'll require extensive conflict-resolution jiu jitsu.
Speaking of linting... Chai core needs it badly
Yup. Part of the point of splitting out the utils into separate modules is so we can tackle standardising things like code coverage and linting piecemeal. Hopefully by chai 5.0 or 6.0 the chaijs/chai repo will be nothing more than a package.json 馃槃
Speaking of v4 release... How do we want to approach merging the 4.x.x branch
Once we're ready with this module, deep-eql and maybe loupe - someone will need to sit down and tackle the 4.x.x branch. I occasionally rebase it when I have some downtime, so it shouldn't be the worst thing by now, but I'm sure it has plenty of conflicts still 馃槥
Well, I'm available to help whenever you guys want to merge 4.x.x. Maybe scheduling some time to do it together would be cool since we all have touched different parts of the code.
@lucasfcosta Correct me if I'm wrong, but the hard part is done (moving pathval to separate module), so all that's left is cleaning up some pathval code in Chai?
@meeber Yes! All that's left is clean up the old pathval code in Chai's core and then making it use the external module.
I plan on doing it this weekend.
Hello everyone!
So, the only thing left before I can start cleaning up the old pathval code in Chai's core is the publication of the new pathval module to NPM.
Let me know if there's any way for me to do this or if you need any help.
Thanks in advance 馃槃
Yes I'm going to put some work into this now. Maybe I'll just re-assign this to me actually.
Thanks @keithamus, feel free to re-assign me whenever you are done, there's no need to rush 馃槃
@lucasfcosta hoped to carve out time to tackle this but I think I'll leave to you and focus on deep-eql 馃槄
@keithamus no problem buddy! :smile:
So, where can I get the saucelabs tokens to put into the travis.yml file?
I think that is the only thing left for us to publish that.
You can read more about it at chaijs/pathval#23.
Oh right, I actually have to do that LOL. Okay, I'll reassign to me and get this done tonight.
I'm going to close this, we merged #830 - @lucasfcosta if there is stuff left to do here could you please re-open.
For now that's all, thanks @keithamus!
Most helpful comment
Speaking of linting... Chai core needs it badly. I'd like to make it a priority after v4 is released.
Speaking of v4 release... How do we want to approach merging the 4.x.x branch? I imagine it'll require extensive conflict-resolution jiu jitsu.