Commit Graph

26 Commits

Author SHA1 Message Date
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
Matt Godbolt
e2a834bcc8 Various package updates (#7799)
Updated all packages with npm update -S. Removed deprecated
@types/url-join

Fixed TypeScript error caused by package updates:
- The `at()` method is ES2022, but frontend code targets ES5 for
compatibility
- Changed `this.compilerPickers.at(-1)` to
`this.compilerPickers[this.compilerPickers.length - 1]`

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-12 09:17:14 -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
5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
Ofek
648795d0f5 Unify CompileChildLibraries and SelectedVersionLibraries (#7022) 2024-10-26 15:53:27 +03:00
Mats Jun
6753449778 Simplify TypeScript types for JQuery elements (#6991)
_No functional changes intended_

The existing type functions a little like this:

"Take the intersection of all common properties of all values in
HTMLElementTagNameMap"

This very much just happens to be the same as HTMLElement, since that's
the declared base for all of the types in HTMLElementTagNameMap. This
small patch simplifies this type (and makes it significantly easier to
read the code)
2024-10-22 19:33:03 +09: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
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
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
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
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
71ae48c8e7 Fix conformance view state bug (#5120)
Fixes #5119 where a type error happens during page load
2023-06-07 19:10:24 -04:00
Jeremy Rifkin
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
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 Larsen
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
Patrick Quist
a15c725c4f Move url expansion to files (#4602) 2023-02-02 22:02:32 +01:00
Jeremy Rifkin
07f37abe76 The War of The Types (#4490) 2023-01-13 19:22:25 -05:00
Rubén Rincón Blanco
924799919c Make Alert and Compiler-Picker widgets (#4366) 2022-11-30 12:41:54 +01:00
Rubén Rincón Blanco
c00e31ab2c Stop beliving the lies of GL's .d.ts (#4209) 2022-10-29 16:29:17 +02:00
Rubén Rincón Blanco
ddafb32feb Try to fix main (#4173)
* Fix Editor not being able to load full links
* Better type for this.filename in compiler.ts
* Updates editor.ts and improves compilation types
* Fix some of the type issues, lots still remain
* fixes to language selection & refactoring of hub and some inits
* fix flow of events
* Fix llvm opt handling (cc @jeremy-rifkin)

Co-authored-by: partouf <partouf@gmail.com>
Co-authored-by: Matt Godbolt <matt@godbolt.org>
2022-10-22 13:59:51 -05:00
partouf
f28f86569c format and lintfixes 2022-10-12 18:07:32 +02:00
partouf
dd4b6072ee bugfixes conformance-view.ts 2022-10-12 17:58:44 +02:00
Markus
5c238822a6 Convert conformance-view.js to typescript (#4109) 2022-10-12 17:07:24 +02:00