Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Blob keyboard navigation: Only load when code intelligence is available#43458

Merged
umpox merged 6 commits into
mainfrom
tr/gate-keyboard-nav
Oct 26, 2022
Merged

Blob keyboard navigation: Only load when code intelligence is available#43458
umpox merged 6 commits into
mainfrom
tr/gate-keyboard-nav

Conversation

@umpox

@umpox umpox commented Oct 26, 2022

Copy link
Copy Markdown
Contributor

Description

Code intelligence is not enabled in our OSS application. This change ensures that we do not attempt to query for stencil data for the OSS product, which caused an error.

I've also split this out into its own query. I think this is required anyway as I've noticed that stencil can sometimes hang sometimes (when code intelligence is still being processed?). Keyboard navigation shouldn't ever block the first render of the blob, so it makes more sense to have this as a separate query.

Test plan

Tested locally, in the OSS product and in enterprise

@cla-bot cla-bot Bot added the cla-signed label Oct 26, 2022
@github-actions github-actions Bot added the frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew. label Oct 26, 2022
Comment thread sg.config.yaml
- gitserver-1
- searcher
- web
- oss-web

@umpox umpox Oct 26, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason sg start oss loads web instead of oss-web. This feels incorrect, as it means lots of things just break currently (e.g. code intelligence menus load and just error). LMK if anyone knows if this change isn't OK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into this same issue yesterday and made this same change in #43450

@umpox umpox marked this pull request as ready for review October 26, 2022 09:29
@umpox umpox requested review from a team, eseliger, keegancsmith and limitedmage October 26, 2022 09:30
@sg-e2e-regression-test-bob

sg-e2e-regression-test-bob commented Oct 26, 2022

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
0.00% (0.00 kb) 0.01% (+0.77 kb) 0.01% (+0.77 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 54292da and 1561d32 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@valerybugakov valerybugakov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally 👍

@keegancsmith keegancsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didnt review the code but tested locally and it works

@umpox umpox merged commit 0279bce into main Oct 26, 2022
@umpox umpox deleted the tr/gate-keyboard-nav branch October 26, 2022 15:01
sqs referenced this pull request Oct 28, 2022
Fixes:

```
TypeError: Cannot read properties of undefined (reading 'fields')
    at API.hasStencils (api.ts:579:84)
```

Related to https://github.com/sourcegraph/sourcegraph/pull/43458, but that did not fully fix the issue (seemingly because the GitBlobLSIFData type is not even introspectible on OSS because LSIF is not available in OSS).
sqs referenced this pull request Oct 28, 2022
* fix error in OSS build when hovering tokens

Fixes:

```
TypeError: Cannot read properties of undefined (reading 'fields')
    at API.hasStencils (api.ts:579:84)
```

Related to https://github.com/sourcegraph/sourcegraph/pull/43458, but that did not fully fix the issue (seemingly because the GitBlobLSIFData type is not even introspectible on OSS because LSIF is not available in OSS).

* remove/unexport local defs

* move useCodeIntel hook to /enterprise/ tree

* move legacy codeintel to enterprise

The search-based code intelligence is an enterprise-only feature. This change clarifies it by showing a nicer message instead of an error if it's attempted to be used in the OSS build. It also cleans up how the enabled-or-not flag is determined in code.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants