mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:11:48 +00:00
Use [esbuild](https://esbuild.github.io/) instead of Webpack for builds of `client/web`, for faster builds (dev and prod) and greater dev-prod parity. This PR completely removes all use of Webpack in this repository. `client/web` is the last build target that still uses Webpack; all others have been recently migrated to esbuild. Most devs here have been using esbuild for local dev of `client/web` for the last 6-12 months anyway. The change here is that now our production builds will be built by esbuild. All sg commands, integration/e2e tests, etc., continue to work as-is. The bundlesize report will take a while to stabilize because the new build products use different filenames. ## Benchmarks Running `pnpm run generate && time pnpm -C client/web run task:gulp webBuild` and taking the `time` output from the last command: - Webpack: 62.5s - esbuild: 6.7s Note: This understates esbuild's victory for 2 reasons: (1) because esbuild is building both the main and embed entrypoints, whereas Webpack only builds the main entrypoint in this benchmark) and (2) because a lot of it is in the fixed startup time of `gulp`; esbuild incremental rebuilds during local dev only take ~1s. ## Notes We no longer use Babel to produce web builds (we use esbuild), so we don't need any Babel plugins that optimize the output or improve browser compatibility. Right now, Babel is only used by Jest (for tests) and by Bazel as an intermediate step.
2.3 KiB
2.3 KiB
Testing a Phabricator and Gitolite instance
Browser Extension
- Verify
sourcegraph.enabledis set totrue - Point your browser extension to a Sourcegraph instance with the following code host:
{ "prefix": "gitolite.sgdev.org/", "host": "git@gitolite.sgdev.org", } - Verify the
sourcegraph.callsignMappingsare correctly set - Make sure your browser extension has permissions for
https://phabricator.sgdev.org(you can check this through the popup) - Navigate to a single file
- Verify "View on Sourcegraph" button is present and working correctly
- Verify hovers work as expected
- Navigate to a diff
- Verify "View on Sourcegraph" buttons are present on all change types, and working correctly
- Verify hovers are working correctly on added, removed, unchanged lines
Native Integration
- Run a local Sourcegraph dev instance tunnelled through ngrok
- Set
corsOriginto"https://phabricator.sgdev.org"in your site config - Add the following Gitolite code host:
{ "prefix": "gitolite.sgdev.org/", "host": "git@gitolite.sgdev.org", } - Verify that the phabricator assets are served:
%NGROK_URL%/.assets/extension/scripts/phabricator.bundle.js%NGROK_URL%/.assets/extension/css/main.css
- Set
sourcegraph.urlto your tunnelled ngrok URL - Verify the
sourcegraph.callsignMappingsare correctly set - Verify
sourcegraph.enabledis set totrue - Navigate to a single file
- Verify "View on Sourcegraph" button is present and working correctly
- Verify hovers work as expected
- Navigate to a diff
- Verify "View on Sourcegraph" buttons are present on all change types, and working correctly
- Verify hovers are working correctly on added, removed, unchanged lines