-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Code cleanup #120
Code cleanup #120
Conversation
BehindTheMath
commented
Jan 30, 2018
- Code cleanup
- Cleanup parse-options tests
- Clean up README
- Remove old switchFallback code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the proposed changes look good to me!
There are a few more long-standing code comments that could possibly do with removing as part of a cleanup too -- things like commented-out module require calls and disabled experimental code. https://github.com/MoOx/pjax/blob/master/lib/switches.js has a lot of examples of this. https://github.com/MoOx/pjax/blob/master/lib/switches-selectors.js#L15-L20 and https://github.com/MoOx/pjax/blob/master/index.js#L12 also spring to mind.
Finally, do we still need the polyfill for Function.prototype.bind
? AFAIK it's supported on all platforms that also fully support the History API.
I'll take a look at those later. BTW, you should also be able to push commits to this PR. Just checkout upstream/cleanup/misc-cleanup, and then push your commits back to the upstream branch. |
Sure, thanks! I made comments rather than commits to avoid stepping on your toes, but if you like, I can action the changes I suggested. Equally happy to leave them to you, if you like. |
Everything looks good, but I think we should leave this open until we're ready to release 0.2.5, in case there's anything we want to add. |
Sounds good to me, hopefully we can get 0.2.5 out fairly soon! |
- Rename objects for clarity and inline unneeded objects - Remove unneeded tests - Use Object.keys().length instead of a custom function - Use typeof === "object" instead of a custom function that checks the prototype tree as well, since we don't expect anything but an object literal.
4f6690a
to
1eb43f7
Compare
I've actioned the items I suggested previously and rebased against master to keep this PR up-to-date. I can't think of anything else that needs cleaning up at present, other than possibly the description in |
lib/eval-script.js
Outdated
script.async = false; // force synchronous loading of peripheral js | ||
if (src !== "") { | ||
script.src = src | ||
script.async = false // force asynchronous loading of peripheral js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robinnorth I'm confused. Why did you change this back? I thought we agreed it was synchronous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I guess I didn't quite successfully resolve that merge conflict... Will fix.
(I think it's probably time for 1.0 ;) ) |
@robinnorth What do you think about that last commit (2ec4c14)? |
It looks like after this PR is merged, all issues milestoned for 0.2.5 will be closed. Is there anything else that needs to be done before working on releasing 0.2.5? |
The library was obviously modularised with testability in mind, but these modules have never had corresponding tests, so it's probably OK to inline them like this.
Only a version bump and any changes to |
@MoOx Should we add everyone who contributed (https://github.com/MoOx/pjax/graphs/contributors)?
I do not. I'll update the changelog and version number, and then @MoOx can publish it. |
With that in mind, should we move out |
It would be great to modularise and be able to independently test these methods, as they're basically the core of the whole library, but it's probably going to be a bit of an undertaking to do so right now. I think we should get this next release out and then add this as an aim for the next major milestone (and close #21 in the process). |
Sounds good. So we're just waiting on @MoOx for an answer about other contributors, and then we can merge this. I have a branch with the updated changelog and the version bump that I'll rebase and push once this is merged. |
Do whatever you feel appropriate. To make changelog easier I would recommend you in the future to only use "Squash and merge" option when merging PR. That helps to have a clean git history with kind of "one pr = one feature or a bugfix" history, which is easy to review and create release notes from. |
If you can give me access, we won't have to bother you in the future. I'll DM you on Twitter.
I wasn't sure which to use, since it looks like in the past sometimes merge commits were used instead of squashing. Also, using merge commits doesn't require as much rebasing. But we can start squashing. |
You have been added to npm ;) For the merging, it's a recommendation. At the time I made this lib, not sure it was a thing :D |
Great, thanks.
@robinnorth What do you think? Should we add anyone else? |
@BehindTheMath it's up to you -- we could add/ask to add anyone who has ever made a contribution via a PR and add a note encouraging future contributors to add themselves to the list when making a PR, or we could just list contributors who have made a significant contribution (i.e. multiple PRs)/have commit access to the repo, or leave it as is. My personal inclination is that one PR doesn't really qualify for 'contributor' status, but you were here before me, so I'll defer to you on this 😄 |
I don't want to slight anyone by leaving them out, but at the same time I think it will get unwieldy if there's a huge list of everyone who submitted commits. I'm going to leave it as it is, and if anyone wants, they can add themselves in. |
I think that's a sensible approach 👍 |