Code cleanup #120

Merged
BehindTheMath merged 13 commits from cleanup/misc-cleanup into master 2018-02-02 09:52:45 -05:00
BehindTheMath commented 2018-01-30 00:01:06 -05:00 (Migrated from github.com)
  • Code cleanup
  • Cleanup parse-options tests
  • Clean up README
  • Remove old switchFallback code
- Code cleanup - Cleanup parse-options tests - Clean up README - Remove old switchFallback code
robinnorth (Migrated from github.com) reviewed 2018-01-30 05:25:20 -05:00
robinnorth (Migrated from github.com) left a comment

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.

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.
BehindTheMath commented 2018-01-30 09:42:12 -05:00 (Migrated from github.com)

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.

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.
robinnorth commented 2018-01-30 12:10:05 -05:00 (Migrated from github.com)

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.

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.
BehindTheMath commented 2018-01-31 16:22:41 -05:00 (Migrated from github.com)

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.

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.
robinnorth commented 2018-01-31 16:44:39 -05:00 (Migrated from github.com)

Sounds good to me, hopefully we can get 0.2.5 out fairly soon!

Sounds good to me, hopefully we can get 0.2.5 out fairly soon!
robinnorth commented 2018-01-31 17:31:21 -05:00 (Migrated from github.com)

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 package.json (and adding a contributors attribute?).

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 `package.json` (and adding a `contributors` attribute?).
BehindTheMath (Migrated from github.com) reviewed 2018-01-31 21:19:45 -05:00
@@ -13,12 +13,12 @@ module.exports = function(el) {
script.type = "text/javascript"
BehindTheMath (Migrated from github.com) commented 2018-01-31 21:19:45 -05:00

@robinnorth I'm confused. Why did you change this back? I thought we agreed it was synchronous.

@robinnorth I'm confused. Why did you change this back? I thought we agreed it was synchronous.
MoOx commented 2018-02-01 01:53:09 -05:00 (Migrated from github.com)

(I think it's probably time for 1.0 ;) )

(I think it's probably time for 1.0 ;) )
robinnorth (Migrated from github.com) reviewed 2018-02-01 02:56:28 -05:00
@@ -13,12 +13,12 @@ module.exports = function(el) {
script.type = "text/javascript"
robinnorth (Migrated from github.com) commented 2018-02-01 02:56:28 -05:00

Oops, I guess I didn't quite successfully resolve that merge conflict... Will fix.

Oops, I guess I didn't quite successfully resolve that merge conflict... Will fix.
BehindTheMath commented 2018-02-01 13:59:22 -05:00 (Migrated from github.com)

@robinnorth What do you think about that last commit (2ec4c14)?

@robinnorth What do you think about that last commit (2ec4c14)?
BehindTheMath commented 2018-02-01 14:04:30 -05:00 (Migrated from github.com)

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?

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?
robinnorth commented 2018-02-01 15:20:51 -05:00 (Migrated from github.com)

@robinnorth What do you think about that last commit (2ec4c14)?

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.

Is there anything else that needs to be done before working on releasing 0.2.5?

Only a version bump and any changes to package.json (I added you and I as contributors, hope that's OK) and then we're good to go! Do you have npm publish access?

> @robinnorth What do you think about that last commit (2ec4c14)? 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. > Is there anything else that needs to be done before working on releasing 0.2.5? Only a version bump and any changes to `package.json` (I added you and I as contributors, hope that's OK) and then we're good to go! Do you have npm publish access?
BehindTheMath commented 2018-02-01 15:28:44 -05:00 (Migrated from github.com)

I added you and I as contributors, hope that's OK

@MoOx Should we add everyone who contributed (https://github.com/MoOx/pjax/graphs/contributors)?

Do you have npm publish access

I do not. I'll update the changelog and version number, and then @MoOx can publish it.

>I added you and I as contributors, hope that's OK @MoOx Should we add everyone who contributed (https://github.com/MoOx/pjax/graphs/contributors)? >Do you have npm publish access I do not. I'll update the changelog and version number, and then @MoOx can publish it.
BehindTheMath commented 2018-02-01 16:37:21 -05:00 (Migrated from github.com)

The library was obviously modularised with testability in mind

With that in mind, should we move out loadUrl(), loadContent(), and afterAllSwitches() to separate files?

>The library was obviously modularised with testability in mind With that in mind, should we move out `loadUrl()`, `loadContent()`, and `afterAllSwitches()` to separate files?
robinnorth commented 2018-02-01 16:59:02 -05:00 (Migrated from github.com)

With that in mind, should we move out loadUrl(), loadContent(), and afterAllSwitches() to separate files?

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).

> With that in mind, should we move out loadUrl(), loadContent(), and afterAllSwitches() to separate files? 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).
BehindTheMath commented 2018-02-01 17:02:34 -05:00 (Migrated from github.com)

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.

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.
MoOx commented 2018-02-02 00:17:29 -05:00 (Migrated from github.com)

Do whatever you feel appropriate.
I can give you npm access if you want or I can release it too. Just tell me what you prefer.

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.

Do whatever you feel appropriate. I can give you npm access if you want or I can release it too. Just tell me what you prefer. 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.
BehindTheMath commented 2018-02-02 00:23:23 -05:00 (Migrated from github.com)

I can give you npm access if you want or I can release it too. Just tell me what you prefer.

If you can give me access, we won't have to bother you in the future. I'll DM you on Twitter.

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.

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.

>I can give you npm access if you want or I can release it too. Just tell me what you prefer. If you can give me access, we won't have to bother you in the future. I'll DM you on Twitter. >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. 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.
MoOx commented 2018-02-02 00:36:03 -05:00 (Migrated from github.com)

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

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
BehindTheMath commented 2018-02-02 00:38:02 -05:00 (Migrated from github.com)

You have been added to npm ;)

Great, thanks.

Do whatever you feel appropriate.

@robinnorth What do you think? Should we add anyone else?

>You have been added to npm ;) Great, thanks. >Do whatever you feel appropriate. @robinnorth What do you think? Should we add anyone else?
robinnorth commented 2018-02-02 04:15:49 -05:00 (Migrated from github.com)

@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 😄

@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 😄
BehindTheMath commented 2018-02-02 09:49:14 -05:00 (Migrated from github.com)

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 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.
robinnorth commented 2018-02-02 10:44:03 -05:00 (Migrated from github.com)

I think that's a sensible approach 👍

I think that's a sensible approach 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#120