-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Prefetch urls in background and insert "real" anchor links #543
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In some cases the file path in PR comment contains head and a base sha like https://github.com/user/repo/pull/123/files/f18370bde83d7f1ced7acf5af54a21d2e53912ff..637d21dd86c8f50e9100b8da656e43cadcccde4d#diff-fd9ad2ea8184b3a5e7d76f54e87ae438
stefanbuck
force-pushed
the
277-real-links
branch
from
February 16, 2019 21:39
29e62ce
to
ed3f5de
Compare
@josephfrazier I think you should be able to push straight to my branch. |
Ah whoops, I was looking directly at the commit, outside the context of a PR, so I thought it might have already been merged. Will do! |
stefanbuck
force-pushed
the
277-real-links
branch
3 times, most recently
from
March 10, 2019 21:50
50266e6
to
15c286c
Compare
stefanbuck
force-pushed
the
277-real-links
branch
from
March 10, 2019 22:04
15c286c
to
13de401
Compare
stefanbuck
force-pushed
the
277-real-links
branch
from
March 10, 2019 22:19
13de401
to
2f91910
Compare
stefanbuck
force-pushed
the
277-real-links
branch
from
March 10, 2019 23:01
abbb328
to
bb40146
Compare
Before this PR is turning into a huge monster, I'm going to merge it into a v5 branch. As far as I can tell everything works as expected. Will do some more testing later this week. |
stefanbuck
added a commit
that referenced
this pull request
Mar 16, 2019
* Remove lazy loader for relative files * Add setting to enable support for private repositories * Insert real href tag * Add token field to settings page * Add octolinker api helper * Align format with new octolinker api * Use ZEIT now deployment * Split head from base sha in url In some cases the file path in PR comment contains head and a base sha like https://github.com/user/repo/pull/123/files/f18370bde83d7f1ced7acf5af54a21d2e53912ff..637d21dd86c8f50e9100b8da656e43cadcccde4d#diff-fd9ad2ea8184b3a5e7d76f54e87ae438 * Resolve urls with either the github or octolinker API * Update E2E test to work with href attribute * Correct grammar See #543 (comment) * Implement simple GitHub search * Remove option to toggle line indicator * Open settings dialog rather than being a new tab * Fix GitHub API call in Firefox * Simplify loader * Add trusted url resolver to reduce load on octolinker api * Fix tests
stefanbuck
added a commit
that referenced
this pull request
Jun 1, 2019
* Remove lazy loader for relative files * Add setting to enable support for private repositories * Insert real href tag * Add token field to settings page * Add octolinker api helper * Align format with new octolinker api * Use ZEIT now deployment * Split head from base sha in url In some cases the file path in PR comment contains head and a base sha like https://github.com/user/repo/pull/123/files/f18370bde83d7f1ced7acf5af54a21d2e53912ff..637d21dd86c8f50e9100b8da656e43cadcccde4d#diff-fd9ad2ea8184b3a5e7d76f54e87ae438 * Resolve urls with either the github or octolinker API * Update E2E test to work with href attribute * Correct grammar See #543 (comment) * Implement simple GitHub search * Remove option to toggle line indicator * Open settings dialog rather than being a new tab * Fix GitHub API call in Firefox * Simplify loader * Add trusted url resolver to reduce load on octolinker api * Fix tests
stefanbuck
pushed a commit
that referenced
this pull request
Jun 1, 2019
* Prefetch urls in background and insert "real" anchor links (#543) * Remove lazy loader for relative files * Add setting to enable support for private repositories * Insert real href tag * Add token field to settings page * Add octolinker api helper * Align format with new octolinker api * Use ZEIT now deployment * Split head from base sha in url In some cases the file path in PR comment contains head and a base sha like https://github.com/user/repo/pull/123/files/f18370bde83d7f1ced7acf5af54a21d2e53912ff..637d21dd86c8f50e9100b8da656e43cadcccde4d#diff-fd9ad2ea8184b3a5e7d76f54e87ae438 * Resolve urls with either the github or octolinker API * Update E2E test to work with href attribute * Correct grammar See #543 (comment) * Implement simple GitHub search * Remove option to toggle line indicator * Open settings dialog rather than being a new tab * Fix GitHub API call in Firefox * Simplify loader * Add trusted url resolver to reduce load on octolinker api * Fix tests * Remove not longer needed new tab background job * Rerun octolinker after progressive-container has loaded * Invoke OctoLinker when expanding a diff view * Rearrange options page * Update API url * Fix blob selector for gists * Perform GET request to leverage the browser cache * Fix blob-reader units tests after refactoring * Fix snippets parsing * readme update * Add demo build step * Add highlight option via url hash * Optimize highlighting for retina * Update description
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The overall goal of this Pull Request is to process links in the background before you actual click on a link. Previously, OctoLinker started processing links just on click for various reasons. From a UX point of view this wasn't really great. It was slow, but more important it broke the expected behaviour of a anchor tag element. It was basically just a dumb anchor tag
<a href="#" />
and we had to re-implement things like CMD+click and middle mouse button to open the url in a new tab. Also hovering over the link to see where OctoLinker takes you wasn't possible. Over the last few months, I did a lot major refactoring which was required to shipping this feature and this change will finally ship the feature.In order to resolve relative links within a repo, OctoLinker is now using the GitHub API. Therefore you need to create a GitHub token for private repositories. The architecture of our OctoLinker service which is responsible to resolve registry packages also changed quite a lot and we will share some updates soon.
I still need to write a few unit + E2E tests followed by a proper Q&A session. I'm considering a beta phase for this release. If you're interested in being a beta tester react with 🚀 below and I'll come back to you.
Fixes #277 #530