Commit Graph

100 Commits

Author SHA1 Message Date
jiakaiz-g
ac56744927 Add compiler overrides for dex2oat (#8435) 2026-02-09 19:27:57 +01:00
Matt Godbolt
53c7dd328b Configure Biome import organiser with grouped imports (#8431)
Enable Biome's `organizeImports` with groups matching the original
ESLint `import/order` configuration:

1. **Node builtins** (`node:fs`, `path`, etc.)
2. *(blank line)*
3. **Third-party packages** (`express`, `@sentry/node`, etc.)
4. *(blank line)*
5. **Local/relative imports** (`../foo.js`, `./bar.js`, aliases)

This resolves the inconsistency where Biome wasn't enforcing import
grouping, meaning new files would lose the blank-line separation that
the old ESLint config enforced.

### Impact
- **354 files** updated out of 738 checked (~48%)
- **+188 / -240 lines** (net -52) — almost entirely single blank line
additions/removals between import groups
- No import reordering; purely group separator consistency

Fixes #7373

🤖 Generated by LLM (Claude, via OpenClaw)
2026-02-01 20:50:46 -06:00
Matt Godbolt
65e4f302b7 URL serialization refactoring and Cypress test improvements (#8215)
## Summary
This PR makes URL serialization logic available to Node.js contexts
(like Cypress tests) and replaces a hard-coded 4812-character base64 URL
in tests with programmatically generated state. This builds on the
shared utilities refactoring from #8246.

### Changes

#### 1. Extract URL Serialization to Shared Module
**Problem:** URL serialization code depended on GoldenLayout's
browser-only ConfigMinifier, preventing Cypress spec files from
importing it (they load in Node.js before running in browser).

**Solution:** Created `shared/url-serialization.ts` with a
Node-compatible ConfigMinifier reimplementation.

**Technical Details:**
- Reimplemented GoldenLayout's ConfigMinifier without browser
dependencies
- Moved serialization functions (`serialiseState`, `deserialiseState`,
`risonify`, `unrisonify`) to shared module
- Moved minification functions (`minifyConfig`, `unminifyConfig`) to
shared module
- Updated `static/url.ts` to use shared module instead of GoldenLayout
- Added comprehensive test coverage in `test/url-serialization.ts`

**Files:**
- **New:** `shared/url-serialization.ts` (~279 lines)
- **Modified:** `static/url.ts` (removed ~30 lines, eliminated
GoldenLayout dependency)
- **New:** `test/url-serialization.ts` (~96 lines)

#### 2. Replace Hard-coded Cypress URL with Programmatic State
**Before:** A hard-coded 4812-character base64 URL containing state for
all panes
```typescript
cy.visit('http://localhost:10240/#z:OYLghAFBqd5TB8IAsQGMD2ATApgUWwEsAXTAJwBoiQIAzIgG...');
```

**After:** Programmatically generated state using
`buildKnownGoodState()` function
```typescript
const state = buildKnownGoodState();
const hash = serialiseState(state);
cy.visit(`http://localhost:10240/#${hash}`, {...});
```

**Benefits:**
- Human-readable, maintainable test state
- Programmatic generation from `PANE_DATA_MAP` keys
- Layout optimized with 8 panes per row
- Produces identical compressed URL format
- Much easier to add/modify panes in the future

#### 3. PANE_DATA_MAP Consistency Improvements
Updated `PANE_DATA_MAP` to use component names exactly as registered
with GoldenLayout:

**Key renames:**
- `preprocessor` → `pp`
- `llvmir` → `ir` 
- `pipeline` → `llvmOptPipelineView`
- `mir` → `rustmir`
- `hir` → `rusthir`
- `macro` → `rustmacroexp`
- `core` → `haskellCore`
- `stg` → `haskellStg`
- `cmm` → `haskellCmm`
- `dump` → `gccdump`
- `tree` → `gnatdebugtree`
- `debug` → `gnatdebug`

**Added panes:** `codeEditor`, `compiler`, `conformance`, `output` (were
missing from map)

**Re-enabled tests:**
- `yul` pane test (was commented out, now fixed)
- `clojuremacroexp` pane test (was commented out, now fixed)
- `cfg` pane test (had TODO, now removed)

**Why this matters:** The `buildKnownGoodState()` function uses
`Object.keys(PANE_DATA_MAP)` as the `componentName` property, so keys
must match the actual registered component names for GoldenLayout to
find them.

## Test Plan
- [x] All Cypress tests pass (confirmed by @mattgodbolt)
- [x] TypeScript compilation passes (`npm run ts-check`)
- [x] Linting passes (`npm run lint`)
- [x] URL serialization tests pass (3/3 tests)
- [x] Pre-commit hooks pass
- [x] Related vitest tests pass

## Dependencies
- Builds on #8246 (shared utilities refactoring - already merged)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-04 14:09:01 -06:00
Matt Godbolt
03d20c5fde Move assert.ts and rison.ts to shared/ directory (#8246)
## Summary
Moves `static/assert.ts` and `static/rison.ts` to `shared/` directory to
make them available to both frontend and backend code without browser
dependencies. Updates all import paths across the codebase (~47 files).

## Motivation
This refactoring eliminates browser dependencies in these utilities,
allowing them to be imported by Node.js contexts (like Cypress test
files) without causing module load failures. This is a prerequisite for
upcoming Cypress test improvements.

## Changes
- Move `static/assert.ts` → `shared/assert.ts`
- Move `static/rison.ts` → `shared/rison.ts`  
- Update `biome.json` to allow `hasOwnProperty` in `shared/` directory
- Update all imports across `static/`, `lib/`, and `test/` directories
(47 files changed)

## Benefits
- No functional changes, purely a code reorganization
- Makes these utilities accessible to both frontend and backend without
circular dependencies
- Enables future Cypress improvements that require these utilities in
Node.js context
- All tests pass ✓ (699 tests)

## Test Plan
- [x] TypeScript compilation passes
- [x] Linting passes
- [x] All unit tests pass (699 tests)
- [x] Pre-commit hooks pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-04 10:58:11 -06:00
Patrick Quist
f5f1566bff Add timing for executable package storage (#8218) 2025-10-28 09:44:51 +01:00
narpfel
9084b9ff4d Make Toggles callbacks statically typechecked (#8118) 2025-09-23 11:19:48 +02:00
Partouf
fa08cb2c3c add time in queue 2025-09-12 01:02:42 +02:00
Matt Godbolt
8734c3e492 Update biome (#7956)
- latest biome, and fix its configuration
- fixes "static" content to be globally configured too (instead of
per-line)
- fixes issues:
  - imports fixed up
  - `Date.now()` vs `+new Date()`
  - some unused things `_` prefixed
 
After discussion with the team, turned off the unused parameter warning.
2025-07-28 10:34:46 -05:00
Jacob Panov
5edc911180 Refactor Enhance Type Saftey in Library Elements (#7925)
Co-authored-by: Mats Jun Larsen <mats@jun.codes>
2025-07-20 07:36:38 +00:00
woruyu
42cf30d7a6 Decouple Site Template images from template name (#7883) 2025-07-04 06:01:20 +00:00
Mats Jun Larsen
03546bc4ef Conditionally render img tags for language logos (#7873) 2025-06-28 16:33:07 +02:00
Mats Jun Larsen
d147341663 Serve all static asset files over the CDN (#7795) 2025-06-28 14:01:36 +02:00
Matt Godbolt
9e9e035b28 Rephrase frontend imports (#7824)
- Removes `rootDirs` so all imports will be relative in the frontend
- Updates (and unifies) imports to be `../types/...` etc instead of
relying on "types" being in the rootDir for the frontend.
- Fixes one type that was being picked up from `lib` in the frontend.
- Adds a precommit hook to check in future

Paves the way to writing _unit_ tests for the frontend for the subset of
the frontend code we can import from `node` (which might be a lot of
it!)
2025-06-18 09:04:23 -05:00
Mats Jun Larsen
5dbb5fff15 Eliminate all usages of require() in the client (#7796) 2025-06-12 21:35:00 +00:00
Mats Jun Larsen
47e8e6d3a7 Replace href=javascript:; with bootstrap link class (#7797)
Fixes #7792

Bootstrap styles `a:has([href])` as a link so the attribute had been
used in the past for things that aren't actually links, yet we want the
style for. It's better to just use `.link-primary` so it doesn't affect
the contents as discovered in #7792
2025-06-13 02:43:14 +09:00
Abril Rincón Blanco
e76c78ccc0 Fix system light theme timing widget visibility (#7653)
Closes
https://github.com/compiler-explorer/compiler-explorer/issues/7647

Fixed timing widget for light system:
<img width="534" alt="Captura de pantalla 2025-05-04 a las 23 32 11"
src="https://github.com/user-attachments/assets/23ea9e4c-160c-40ab-a1f7-aa3976ba4a0b"
/>

Also made the pink theme use the default chart.js colours, as I think
they have more contrast than white-on-pink
2025-05-12 12:52:56 -05:00
Matt Godbolt
993b8ec7a7 Cleanup post bootstrap 5 (#7608)
Remove some unnecessary functions and clarify docs.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-04-24 18:41:55 -05:00
Matt Godbolt
82eff66c49 Handle items that don't exist in embedded mode; fix iframe generation (#7605)
Checked locally. Have no idea how the heck the quotes got changed....
2025-04-24 14:09:02 -05:00
Matt Godbolt
637564f389 Migrate to Bootstrap 5 (#7582)
This PR completes the migration from Bootstrap 4 to Bootstrap 5.3.5
following the plan outlined in
[docs/Bootstrap5Migration.md](https://github.com/compiler-explorer/compiler-explorer/blob/mg/bootstrap5/docs/Bootstrap5Migration.md).

## Migration Process

We followed a phased approach as documented in the migration plan:

1. **Phase 1: Dependency Updates and Basic Setup**
   - Updated Bootstrap from 4.6.2 to 5.3.5
   - Added @popperjs/core dependency (replacing Popper.js)
   - Updated Tom Select theme from bootstrap4 to bootstrap5

2. **Phase 2: Global CSS Class Migration**
   - Updated directional utility classes (ml/mr → ms/me)
- Updated floating utility classes (float-left/right → float-start/end)
   - Updated text alignment classes (text-left/right → text-start/end)

3. **Phase 3: HTML Attribute Updates**
- Updated data attributes to use Bootstrap 5 prefixes (data-bs-toggle,
data-bs-target, etc.)
   - Fixed tab navigation issues

4. **Phase 4: JavaScript API Compatibility Layer**
   - Created bootstrap-utils.ts compatibility layer
- Updated component initialization for modals, dropdowns, popovers, etc.

5. **Phase 5: Component Migration**
- Updated and tested specific components (modals, dropdowns, toasts,
etc.)
   - Fixed styling issues in cards and button groups

6. **Phase 6: Form System Updates**
   - Updated form control classes to Bootstrap 5 standards
   - Updated checkbox/radio markup patterns
   - Simplified input groups

7. **Phase 7: Navbar Structure Updates**
   - Updated navbar structure with container-fluid
   - Fixed responsive behavior

8. **Phase 8: SCSS Variables and Theming**
   - Added custom CSS fixes for navbar alignment
   - Verified theme compatibility

9. **Phase 9: Accessibility Improvements**
   - Updated sr-only to visually-hidden
   - Added proper ARIA attributes
   - Enhanced screen reader support

## Key Changes

- No more jQuery dependency in Bootstrap 5
- New prefix for data attributes (data-bs-*)
- Improved accessibility with ARIA attributes
- Updated positioning classes (start/end instead of left/right)
- Simplified input group structure

## Test Plan

1. **Navigation Testing**
   - Verify all dropdown menus open and close properly
   - Test mobile menu responsiveness
   - Check tab navigation in settings dialog

2. **Component Testing**
- Verify all modals open and close correctly (settings, share,
load/save)
   - Test tooltips and popovers
   - Check form controls in different dialogs

3. **Layout Testing**
   - Test responsiveness on different screen sizes
   - Verify proper alignment of elements
   - Check dark mode compatibility

4. **Specific Features to Test**
   - Compiler selection and options
   - Share dialog functionality
   - Settings dialog
   - Tree view (IDE mode)
   - Font selection dropdown

5. **Browser Testing**
   - Test in Chrome, Firefox, Safari
   - Test in mobile browsers

## Note on Further Improvements

After this migration is stable, we could consider Phase 12: removing
jQuery dependency entirely, as Bootstrap 5 no longer requires it. This
would be a separate effort.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-04-24 12:10:37 -05:00
Ofek
e01aa3e691 Various type improvements 2025-02-26 02:07:09 +02:00
Mats Jun Larsen
127c12e0bf Re-enable noShadowRestrictedNames Biome rule (#7387)
I'm not very opinionated on this, but I think it makes enough sense to
do
2025-02-13 00:43:55 +09:00
Ofek
f63cee7f9f Add missing js suffixes to imports (#7382)
Seems to be required by es6 and accepted by the current es5
2025-02-09 21:55:48 +02:00
Mats Jun Larsen
5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00: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](00648a7e1c/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](2307e16fa4/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