Commit Graph
80 Commits
Author SHA1 Message Date
Mats Jun Larsen d2cdc3b575 Apply fixes to rebase 2025-02-03 02:23:24 +09:00
Mats Larsen aa85d1fa51 Apply manual fixes 2025-02-03 02:22:58 +09:00
Mats Larsen b4c949afcd Apply automatic fixes
# Conflicts:
#	static/widgets/history-widget.ts
2025-02-03 02:21:16 +09:00
Ofek e2fc92f420 Overhaul 'history' look (#7352)
Single tab, no diffs - single source display, no list bullets, added spacing, added syntax highlighting.
2025-02-01 21:29:29 +02:00
Mats Jun Larsen c256b922f7 Migrate site templates to yaml config (#7189)
Does some winter cleaning on the site-template stuff :)

1. Migrated away from the custom conf format to plain old yaml
2. Made the images and image files match with the name from the yaml
file. (It's not a problem to have spaces in file paths, nor urls so I
don't see why we shouldn't)
3. Updated the relevant documentation

There is a small breakage in the api response for the meta field. It now
returns `{"screenshot_dimensions":{"width":1000,"height":800}}` which I
believe is a lot more useful than
`{"meta.screenshot_dimensions":"1000x800"}`

Besides, I don't believe this endpoint has any third-party consumers
that rely on the metadata since it's a rarely known feature anyways
2024-12-08 00:59:58 +09:00
Mats ea29a6e9d6 Separate list and load actions for source API (#7090)
This is the first PR in API consistency with more to come:

1. The source API urls have been properly defined with
`/source/:source/list` and `/source/:source/load/:language/:filename`
- These used to be two API endpoints mushed together into one `handle()`
function. They are now separate
- While it may appear from the tests that this is an API breakage,
there's currently no way to have the source API spit out responses for
stuff like `/source/moose/load/Grunkle`.
2. The frontend code calling the list api now has shared types
3. Code has been migrated to `/lib/handlers/api/source.ts`
- I've moved code here, because I would like to separate the stuff
that's under the API and the stuff that isn't (e.g., healthcheck)
- The source endpoint is currently not under /api, but I believe it
makes sense to move it.
4. GitHub is terrible at showing the diff, but the `browser.ts` file has
been removed, since it's never actually used. Our frontend only calls
`/source/builtin/...` and it never had any entries. Besides, the type
used on the frontend for the locally stored stuff is different...
2024-11-27 13:54:47 +09:00
Ofek c1985d64a1 Tsification binge #7 (#6974) 2024-10-25 12:19:04 +03:00
Ofek e98d361127 Add display for internal compiler id (#7010)
Implement #6985
2024-10-24 14:28:51 +03:00
Ofek caca3ea6c7 Eliminate all google-analytics dead code (#6954)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-10-10 21:21:43 +03:00
Patrick Quist e259b275cc Remember the compiler pickers isa and group filters + search (#6931) 2024-10-08 22:04:17 +02:00
Ofek f715dc2932 More tsification (#6877)
About half way through. Only 708 tsification errors to go..
2024-09-28 10:32:36 +03:00
Matt Godbolt 72d2fdccc1 Apply the font scale when we know the target (#6849)
This fixes an ordering issue with font scales. The issue would happen if
you changed the default font scale and then e.g. opened a tool window.
It would have the "default" size selected; but it wouldn't apply to the
editor window.
2024-09-10 16:00:13 -05:00
Patrick Quist 3a278ad3b3 Add library lookupname to support binary builds for boost (#6814) 2024-09-04 19:18:37 +02:00
Ofek 12f6bfcc12 Make pane-renaming central (#6772)
When each `Pane` (and others) create their own `PaneRenaming`, which
extends `EventEmitter.EventEmitter`, when one actor emits `renamePane`
no other actor can hear it.

This PR makes `PaneRenaming` stop using its own event emission, and
instead use the central `Hub` it now receives at its ctor.
2024-08-17 22:51:11 +03:00
Ofek 4cdef67bba fix Alert (#6771)
All `Alert` modal windows reuse the same yesButton/noButton.
The callback are setup in the Alert ctor -
```
        const yesNoModal = $('#yes-no');
        yesNoModal.find('button.yes').on('click', () => {
            this.yesHandler?.();
        });
        yesNoModal.find('button.no').on('click', () => {
            this.noHandler?.();
        });
    }
```
On every yes/no click, *All* callbacks of *All* alert instances are
called.
So each `Alert` instance needs to cleanup its callbacks after usage, and
it tries to - via the weirdly named `toggleEventListener`.
`toggleEventListener` only did

```
element.off(eventName);
```
Some of the renaming problems were caused by persistance of [this
callback](https://github.com/compiler-explorer/compiler-explorer/blob/00648a7e1c38c9172c5226d1f64511b8bebfe1c9/static/widgets/pane-renaming.ts#L68-L72).
Extending the cleanup to -
```
        element.off(eventName);
        this.yesHandler = null;
        this.noHandler = null;
```
seems to solve it this particular problem - not even sure `element.off`
is even needed.
2024-08-17 22:50:46 +03:00
Ofek 2055f087d5 Make scroll-up increase the font size and scroll-down decrease it (#6705)
Just feels more natural
2024-07-23 16:22:46 -04:00
Patrick Quist cdb59644cc Add build info for libraries (#6639) 2024-06-29 00:03:09 +02:00
Ofek a9ad41bc1f Fix bad paste (#6555) 2024-06-05 13:18:14 +03:00
Ofek 8317b61b7c Some extra safety, following sentry-caught exceptions (#6553)
This is the crash:
https://compiler-explorer.sentry.io/issues/5427865018/

Looking at [where these values are
populated](https://github.com/compiler-explorer/compiler-explorer/blob/2307e16fa485bf5d92dd28e0d88bfde9cf6d9b99/lib/base-compiler.ts#L2711-L2715)
my conjecture is that `BigInt.toString` failed and returned undefined /
null, but I see no documented conditions that can trigger this (maybe
[just for ridiculous
values](https://stackoverflow.com/a/75593358/89706)).
2024-06-04 09:20:53 +03:00
Ofek 42533d8dbb Stop duplicating hasXXoutput + XXoutput (#6476)
When you need to check if `XXoutput` exists, check it directly.
+some TSification in CompilationResult
2024-05-14 20:11:09 +03:00
Ofek bcb397f56b Add noUnusedLocals to tsconfig + fix the new alerts (#6396)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-05-14 18:46:22 +03:00
Mats Jun 5738ed00e7 Implement alert filters for library dialog (#6325)
Hey friends, it's been a while since last time :)

There are quite a few conditions/cases where the library alert will pop
up, without anything meaningful inside of it. This is particularly the
case for Rust where you have the 100 crates on stable, but zero support
in beta/nightly. I figured informing the user in cases like this would
be nice to have.

This PR adds a rather simple alerting mechanism to alert the user of any
conditions that might not be as apparent (such as Rust crates only being
on stable)

Below is a small gif of how it works. I'm not sure this is the easiest
way to convey this information (especially considering the modal popup
overshadows the alert) so please share any other ideas. Maybe it's
better to have the content fill the modal instead?

![Peek 2024-04-07
00-43](https://github.com/compiler-explorer/compiler-explorer/assets/42585241/53b8a8ad-3f5a-4500-83ce-af627f2e5655)

Relevant issues: #3766 #6250
2024-04-07 01:31:23 +02:00
Ofek bd7ed1a10c Fix #5847 but seriously this time - addition to PR #5882 (#5980)
The previous fix applied only to runtime-tools.
2024-01-12 22:10:58 +02:00
Matt Godbolt 758475b82a Update all the things (#5958)
Not updating `chai` as stuff breaks, but everything else...
2024-01-08 21:19:31 -06:00
Ofek f8dd324af3 Fix #5847 : allow equal-chars while parsing env vars (#5882) 2023-12-15 21:50:21 +02:00
Ofek cce6125929 Fix #5820 (#5831)
The same dropdown glitch described in the bug happens for the compiler
selection dropdown. This addresses both.
2023-12-10 14:06:45 -06:00
J. Ryan Stinnett c3e1b04c31 Rename opt pipeline without LLVM prefix (#5828)
This prepares for future work that will reuse the opt pipeline view
outside of the LLVM ecosystem by renaming related components to remove
the LLVM prefix.

The pass dumper keep its LLVM prefix, as it is assumed this part is
likely to be customised for each compiler ecosystem.

The historical component name has been preserved in the component list
as an alias to keep old links working.
2023-12-03 11:33:42 -05:00
David Spickett 4fff49c7b1 Improvements to the display of Overrides favourites (#5758) 2023-11-29 03:10:07 +01:00
David Spickett 17a6aa7480 Disable buttons for favorite overrides that are incompatible with the current compiler (#5748) 2023-11-29 03:05:08 +01:00
Matt Godbolt af532ddf8d Bump to latest tom-select. Thanks @oyejorge (#5779)
Worked just fine in local testing!
2023-11-20 21:44:10 -06:00
Patrick Quist 455d92916a Execution with heaptrack (#5644) 2023-11-07 23:59:40 +01:00
Patrick Quist 4481bd0f3a Show up to date version for trunk compilers (#5571) 2023-10-15 15:56:43 +02:00
Sergei Murzin 66d1be9c66 fix: Do not add default libraries to state if previous state exists (#5440) 2023-09-04 14:28:32 +02:00
Matt Godbolt e4b791ce92 Use session _then_ local storage for saved state (#5277)
In conversation with @mknejp he pointed out that it can be frustating
when having a browser loaded up with many tabs of CE links, then
reloading the browser (e.g. a reboot, or open/closing the tabs), that
upon reload all the tabs will have the same, shared state (corresponding
to whichever saved to local storage last).

This change:
- stores state in _both_ session and local storage
- removes from both on UI reset
- loads first from session storage and then falls back to local storage

The net result is:
- tabs reopened with "ctrl-shift T" will regain their prior state, as do
any other tabs for which the browser thinks are part of the same session
(like on a "reopen tabs" plugins etc)
- newly-opened tabs still have the prior behaviour of using whatever the
most recently opened tab had as its starting state

Some more info on session vs local storage
[here](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)
2023-07-23 18:08:33 -05:00
Matt Godbolt 87024e2239 Bump latest deps (#5252) 2023-07-10 21:31:04 -05:00
Jeremy Rifkin 4260313e13 Common utilities and type work (#5200)
This PR refactors some common utilities out of lib/ and into shared/ and
eliminates some use of underscore.js, as well as general type
improvements done along the way.
2023-06-28 20:13:10 -04:00
Jeremy Rifkin e267286553 Support user site templates (#5180)
Long overdue
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/d8a56216-d6b0-459a-8539-9f519c023b92)
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/133da5e6-2717-464a-a5fc-5983a3f75014)
2023-06-19 22:33:40 -04:00
Jeremy Rifkin 3716cbd446 Support control flow graphs from the IR pane (#5155)
On top of #5154


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/7bf25b5b-8988-42ff-9d8c-233e6d817997)

Additionally, while I was here, added support for multiple control flow
graphs to be opened from one compiler instead of disabling the button
once one is opened. And improved the implementation for how this was
done for the llvm opt pipeline.

And did some type work along the way.
2023-06-19 21:48:20 -04:00
Jeremy Rifkin 1d44b6d2b4 War on @ts-expect-error (#5171)
Following up on #5170, let's just get rid of @ts-expect-error and
@ts-ignore completely in the codebase. (Well almost)
On top of #5170
2023-06-18 15:21:50 -04:00
Jeremy Rifkin 74e177dd0b Fix ordering in the compiler picker popup (#5132)
No more of this nonsense, long overdue fix

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/bf55a8bb-63a9-47dc-802e-d24df465d422)
2023-06-11 18:00:12 -04:00
Jeremy Rifkin 34292238c1 Identify unused imports during lint (#5130) 2023-06-11 17:35:59 -04:00
Jeremy Rifkin 0364ef87ad Use a discriminated union for the ConfiguredOverride type (#5075)
Closes #5054
2023-05-25 13:10:54 -04:00
Patrick Quist 079d495757 Compiler overrides (#5001) 2023-05-16 03:53:57 +02:00
Patrick Quist e57ba99ce7 chart version migration fix (#4969) 2023-04-19 22:01:14 +02:00
Jeremy Rifkin 69568af990 Fix issue with all alert popups being red (#4891)
All alertSystem.alert popups have a red border at the moment, even when
isError is not set to true
2023-03-20 17:03:13 -04:00
Jeremy RifkinandMatt Godbolt 55dc09017e Compiler Picker UI Improvements (#4849)
Alrighty, round 2!

This PR makes the compiler picker dropdown taller (max height is to the
bottom of the screen)

![image](https://user-images.githubusercontent.com/51220084/224517409-17706ba6-fe85-444a-ad3b-f244f66eea5b.png)

I've added a toolbar button for opening the popout as well as a button
when the dropdown is open:


![image](https://user-images.githubusercontent.com/51220084/224517304-6478fca5-7bc1-4f87-b2ae-e9091d7d48bc.png)

![image](https://user-images.githubusercontent.com/51220084/224517317-83468805-1e9d-4bc6-8a4f-8786325f1e7b.png)

Then the modal interface allows text searching, filtering by compiler
category, and filtering by compiler instruction set. In the future I'd
like to replace the instructionSet property with an architecture
property so the filtering here can be a little better.


![image](https://user-images.githubusercontent.com/51220084/224517348-9cf40866-c5af-4274-84ba-21eb640ab2ea.png)

Demo of the category filtering:


![image](https://user-images.githubusercontent.com/51220084/224517529-5370b3f9-9ad3-4340-838a-b2d0a47c7467.png)

The text filtering highlights results the same as tomselect does:


![image](https://user-images.githubusercontent.com/51220084/224517490-d0dfa6d0-9b61-4be4-8cc7-ca4a4729a532.png)

I moved the favorites permanently to their own column so compilers
aren't jarringly shifted around the screen when favoriting /
unfavoriting.

Also added media queries so the modal looks ok on smaller screens:


![image](https://user-images.githubusercontent.com/51220084/224517563-bdf409c1-7e3a-4c73-812b-f02179b55799.png)


![image](https://user-images.githubusercontent.com/51220084/224517574-07fa2c8b-67d2-496d-9174-b1343e22bd62.png)

I think the only other two changes from the first PR are now the active
compiler is highlighted like it is in the tomselect dropdown and I
figured out how to reliably focus the search bar on modal open. (Oh, and
now clicking a compiler actually does something!)

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-03-12 17:07:44 -04:00
Jeremy Rifkin bbabd514a5 Update error alert styling (#4860)
![image](https://user-images.githubusercontent.com/51220084/224565888-e0b98abf-6e1c-4914-8695-b31a2275b364.png)
2023-03-12 17:03:36 -04:00
Jeremy Rifkin ea107a5ff9 More work needed, thanks for the comments Ruben and Matt! :)
Revert "Compiler picker UI improvements (#4789)"

This reverts commit d4a8c2bdb2.
2023-03-07 10:46:33 -05:00
Jeremy Rifkin d4a8c2bdb2 Compiler picker UI improvements (#4789)
Makes the compiler picker dropdown a bit taller, prevents the dropdown from overflowing the page, and also adds a compiler picker popup
2023-03-04 19:55:25 -05:00
Mats Jun LarsenandMatt Godbolt 633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00