Commit Graph
33 Commits
Author SHA1 Message Date
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
Partouf c79cf686e6 hotfix diff view 2025-06-28 23:15:27 +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
7a7622094b Fix null compiler error in diff pane (#7762)
## Summary
- Fix TypeError when diff pane receives execution results before
compiler is registered
- Add null check to prevent crash and gracefully handle race condition

## Description
This PR fixes issue #7761 where a `TypeError: Cannot set properties of
null (setting 'compiler')` occurs in the diff pane.

### The Problem
A race condition can occur where:
1. An executor pane resends its results (e.g., during layout
initialization)
2. The diff pane receives the `executeResult` event
3. The diff pane tries to update its state, but `this.compiler` is still
null
4. The code crashes trying to set `this.compiler.compiler = compiler`

### The Solution
Add a null check in the `update` method of `DiffStateObject`. If
`this.compiler` is null, we simply ignore the update and return false.
This is safe because:
- When `onCompiler` is eventually called, it will properly initialize
the compiler
- `onCompiler` calls `onDiffSelect()` which calls
`requestResendResult()`
- This will re-request the compilation/execution results
- By then, the compiler will be properly initialized and the update will
succeed

### Testing
- TypeScript checks pass
- Linting passes
- The fix prevents the crash while maintaining correct behavior

Fixes #7761

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-06 12:51:12 -05:00
Matt GodboltandClaude 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
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
Mats Jun Larsen 5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
Partouf 99de0f1dac hotfix diff view 2024-11-28 10:03:19 +01:00
Ofek 20b8ccaa6f Remove ICompiler, other minor type fixes (#7079) 2024-11-25 18:36:20 +02:00
Ofek a0fe0e3d4f In diff view, protect against undefined asm (case of a failed build) (#7030)
Fixes #7029
2024-10-27 09:20:31 +02:00
Ofek 4e5348ab77 Tsify tools (mostly) (#7018)
This includes among others:
 - Proper tsification of various tools code,
 - Elimination of the `CompilationInfo2` type,
 - Use of `CompilationInfo` instead of `Record<any, any>` in some places
 - These lines in CompilationResult:
```
    // Temp hack until we get all code to agree on type of asm
    asm?: ResultLine[] | string;
```

The next task would be to get all code to agree on the type of
CompilationResult.asm, thereby enabling fixing of most the remaining
TSification.
2024-10-26 10:58:30 +03:00
Ofek c1985d64a1 Tsification binge #7 (#6974) 2024-10-25 12:19:04 +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
narpfel 3beeef8fe3 Implement more diff types (#6730)
Add support for diffing clang ASTs, LLVM IR, and Rust HIR, MIR and macro
expansions. These new options are only shown in the picker when the
compiler supports the respective output type (e. g. when diffing `g++`
output, there will be no item to select LLVM IR).

Because the specified output must be activated manually, this PR also
adds help texts so that the user isn’t shown an empty pane. E. g. when
diffing execution stdout but “Execute the code” is not checked, the diff
viewer will show “<activate 'Output...' → 'Execute the code' in this
compiler's pane>”.

Resolves #6726.
2024-07-29 22:19:59 -05:00
Patrick Quist d2c7a5222e Local/Remote Execution environment (#6413) 2024-05-26 22:09:01 +02: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
Patrick Quist 004f3f4006 fix missing createEditor changes (#6099)
Fixes #6088 

Changes the createEditor implementations that were missed in
https://github.com/compiler-explorer/compiler-explorer/pull/6078
2024-02-05 21:10:50 +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
Jeremy Rifkin 72e6b34d55 Improve pane typing (#5191)
Resolves #4365
2023-06-21 21:40:35 -04:00
Jeremy Rifkin c779507000 Create a print view (#5161)
This PR adds a print view for CE

Closes #4617


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/92e5ceab-10cc-4289-a742-592e379627ef)

At the moment syntax highlighting isn't working. I think we need a way
to get style definitions from monaco. I've opened an issue at
https://github.com/microsoft/monaco-editor/issues/4031. For the CFG
pane, using the monaco classes "just works", but for some reason when
@media print is applied those definitions go away. We'd want to always
use light mode colors anyway.
2023-06-19 22:13:45 -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
Patrick Quist 3154327800 Device view diff (#4973) 2023-04-19 23:20:31 +02: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
Jeremy Rifkin 384c297906 Fix trailing comma issue (#4775)
Make trailing commas more consistent throughout the project, fixes
config conflict between eslint and prettier. Resolves an oversight in
#4766.
2023-02-26 12:21:35 -05:00
Jeremy Rifkin 07f37abe76 The War of The Types (#4490) 2023-01-13 19:22:25 -05:00
Rubén Rincón Blanco f1a4f169a9 Fetch settings in initializeGlobalDependent (#4307) 2022-11-25 12:41:15 +01:00
Paul Taylor 1476937e82 Add split host/device views for CUDA C++ (#4177)
* make nvcc show the device asm view button, stop after compiling host assembly
* keep and extract ptx device code
* paper over some typescript compile errors (maybe mitigating orchidjs/tom-select#500, orchidjs/tom-select#501)
* await on promise-returning methods
* use gcc objdump for nvcc host code, add nvdisasm to disassemble SASS .cubin
* append device ASM lines to result ASM so they're also colourized
* append device ASM to all ASM
* automatically open the device pane if the compiler supports emitting device ASM
* save device view open boolean in compiler state
* make the nvcc compiler return all PTX and SASS results as separate devices
* ensure line hover highlights propagate from editor to compiler panes, and are re-applied when the user changes the selected device
* update cuda properties
2022-10-24 20:28:01 -05:00
Patrick QuistandRubén Rincón Blanco 8205573365 add compilationinfo and related types (#4051)
* add compilationinfo and related types

* fix mtime type

* Add rest of compiler keys

* Make it compile

* Rename Compiler type to CompilerInfo as per Partouf's suggestion

* Get ready for #4077

* Linter fixes

Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
2022-09-20 08:00:24 -05:00
Mats Larsen 1f5fbe0e28 Replace provide-plugin jquery imports with import statements (#3943) 2022-08-07 11:58:16 +02:00
c315d6a719 Move compiler-service.js to TS (#3672)
Co-authored-by: Mats Larsen <me@supergrecko.com>
Co-authored-by: partouf <partouf@gmail.com>
2022-06-21 23:31:18 +02:00
Rubén Rincón Blanco 330ca8deb1 Define the list of available eventHub events (#3686) 2022-05-27 22:55:42 +02:00
Patrick Quist 88cb7d65ac Base-compiler to typescript (#3718) 2022-05-27 22:51:23 +02:00
Jeremy Rifkin ed8d0674c2 Convert diff view to ts (#3676)
* Draft conversion

* Typescriptification

* Linter changes

* More changes

* fix

* Implemented feedback

* Interface -> type, oops

* Added copyright / license
2022-05-20 13:12:09 -04:00