Commit Graph

56 Commits

Author SHA1 Message Date
Matt Godbolt
d2cc7118aa Minor updates and lint and format fixes (#8327) 2025-12-09 22:16:59 -06:00
Frank Leon Rose
b9dc265973 Clojure language support (#8146)
<img width="1405" height="474" alt="Clojure in Compiler Explorer 2"
src="https://github.com/user-attachments/assets/76dfed9b-d0eb-4764-b371-9c6023088a50"
/>

With Macro Expansion:
<img width="1642" height="594" alt="image"
src="https://github.com/user-attachments/assets/8b511af9-3617-426e-868d-5a99e5db5756"
/>

TODO
- [x] Language configuration
- [x] Compile via wrapper
  - Inject namespace if necessary to simplify minimal code sample
  - Parse Unix style command line parameters into compiler bindings
  - Place file in path according to namespace
- [x] Install some versions of Clojure [PR
here](https://github.com/compiler-explorer/infra/pull/1849)
- [x] Macroexpansion view (modeled on Rust macro expansion view)
- [x] Filter out command line options that would break wrapper operation
- [x] ~~Parse `--help` output to a list of options~~ Reverted because
not applicable.
- [x] Short form compiler options
- [x] Support Clojure compiler settings via env var, like
`JAVA_OPTS=-Dclojure.compiler.direct-linking=true
-Dclojure.compiler.elide-meta=[:doc,:file]`

NOT DOING
- [x] ~~Support loading dependencies~~ Non-trivial enhancement. Not
necessary for initial release.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2025-10-22 09:04:20 -05:00
Patrick Quist
b3c6a321f1 Add compilation worker mode infrastructure (#7864) 2025-09-08 22:07:47 +02:00
Matt Godbolt
e9011ec592 Phase 3: Automate Golden Layout CSS Import Processing (#7977)
## Problem

The SCSS migration encountered issues with Golden Layout CSS imports:

1. Sass `@import` statements are deprecated and will be removed in Dart
Sass 3.0.0
2. `@use` cannot be used inside conditional blocks like
`html[data-theme='default']`
3. The `~` webpack resolver doesn't work with `@use`, only `@import`

Current problematic code:
```scss
html[data-theme='default'] {
    @import '~golden-layout/src/css/goldenlayout-light-theme';
}
```

## Solution

Added a custom webpack loader that automatically inlines Golden Layout
CSS content at build time.

**Custom Loader** (`etc/webpack/replace-golden-layout-imports.js`):
- Detects `@import` statements for `~golden-layout/src/css/*` files
- Reads CSS content from `node_modules/golden-layout/src/css/`
- Replaces import statements with actual CSS content
- Uses generalized regex to handle any golden-layout CSS file

**Integration & Cleanup**:
- Positioned before sass-loader in webpack processing chain
- Automatically syncs with Golden Layout package updates
- Consolidated all webpack loaders in `etc/webpack/` directory
- Moved pug loader from `etc/scripts/parsed-pug/` to `etc/webpack/`
- Converted both loaders to ES modules for consistency
- Removed unnecessary `package.json` override

## Result

Eliminates Sass deprecation warnings while preserving existing theme
architecture. Build-time processing with no runtime overhead. Cleaner
webpack loader organization.

## Files Changed

- `webpack.config.esm.ts` - Updated loader paths and added Golden Layout
processor
- `etc/webpack/replace-golden-layout-imports.js` - Custom loader
implementation
- `etc/webpack/parsed-pug-loader.js` - Moved from
`etc/scripts/parsed-pug/` and converted to ES modules
- Removed `etc/webpack/package.json` - No longer needed with ES modules
- Removed `etc/scripts/parsed-pug/` directory - Consolidated into
webpack directory

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-05 15:00:42 -05:00
Matt Godbolt
0eee48a0fb Optimize logo file sizes to reduce webpack bundle size (#7979)
## Summary
- Optimized 13 logo files, reducing total size by ~560KB
- Converted hylo.svg (321KB) and nim.svg (126KB) to optimized PNGs
(27KB, 13KB)
- Resized oversized images to max 256×256 while preserving aspect ratios
- Optimized SVGs with SVGO where beneficial
- Fixed file permissions (removed execute bits from image files)
- Added comprehensive README.md with optimization guidelines

## Files Changed
- `lib/languages.ts`: Updated references from hylo.svg → hylo.png,
nim.svg → nim.png
- `public/logos/`: Optimized multiple logo files
- `public/logos/README.md`: New optimization guidelines for future logo
additions

## Size Reductions
- hylo.svg → hylo.png: 321KB → 27KB (92% reduction)
- nim.svg → nim.png: 126KB → 13KB (90% reduction)  
- scala.png: 79KB → 14KB (82% reduction)
- haskell.png: 19KB → 6.5KB (66% reduction)
- pony.svg: 53KB → 35KB (34% reduction)
- odin.png: 48KB → 27KB (44% reduction)
- nix.svg: 26KB → 5KB (81% reduction)
- gimple.svg: 21KB → 11KB (48% reduction)
- spice.png: 16KB → 9.3KB (42% reduction)
- hook.png: 14KB → 9.3KB (34% reduction)
- hook-dark.png: 13KB → 9.3KB (28% reduction)

## Test plan
- [x] Verify all logos display correctly in the language selection UI
- [x] Confirm no broken image references
- [x] Check that webpack bundle size warnings are reduced
- [x] Ensure visual quality is acceptable at small icon sizes

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-31 16:07:04 -05:00
Matt Godbolt
ba77b3ea97 Bump all the minor packages (#7955)
Picks up fix sinonjs/samsam#253 (yay)
2025-07-28 08:54:41 -05:00
Mats Jun Larsen
d147341663 Serve all static asset files over the CDN (#7795) 2025-06-28 14:01:36 +02:00
Mats Jun Larsen
f88cc624e5 Add back missing console.log in webpack config
Seems I accidentally deleted this in the biome pr 🤔
2025-06-23 16:36:13 +09: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
Matt Godbolt
917c7f9dca Monthly upgrade of all the things (#7758)
Tested with a local run and a poke in the UI
2025-06-04 09:01:27 -05:00
Matt Godbolt
74e5f237eb Update all the things (#7699)
All minor updates, commander was one major update but only to support
node 20 (which we're already past).

Tests pass, everything loaded up locally.
2025-05-19 06:51:21 -05:00
Matt Godbolt
cfcbcd7423 Minor bump all packages (npm update -S) (#7401) 2025-02-18 13:27:36 -06:00
Ofek
1aef3f3863 Fix default imports/exports to be ES6 conformant (#7383)
<!-- 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!
-->
2025-02-09 22:33:36 +02:00
Mats Jun Larsen
5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
Ofek
2df8d32758 Tsify #6 (#6941)
Another tsification batch. 347 to go and I'm running out of easy fixes
:(
2024-10-22 21:41:44 +03:00
Partouf
657517e09e version 2024-09-25 18:13:34 +02:00
Patrick Quist
bc507a3c70 Update webpack.config.esm.ts 2024-09-25 15:42:02 +02:00
Ofek
9ef46fbafe Binge of (mostly) mindless tsification (#6838)
Turned on `noImplicitAny` in tsconfig, then went around fixing some
random easy stuff.
Hopefully tsification-PRs with more real content coming up.
2024-09-07 14:36:43 +03:00
Matt Godbolt
cd4ca1b2a7 Mostly revert versions back to June 3rd (#6614)
- Reverts all but monaco-editor to
46437d8942
- Also bumps webpack version forward

We've been having stability issues traced back to apparent issues in AWS
or smithy.
2024-06-16 13:28:59 -05:00
Matt Godbolt
862b341dff Bound to need this too 2024-06-10 21:51:46 -05:00
Matt Godbolt
f80b677acf Bump version 2024-06-07 21:00:58 -05:00
Matt Godbolt
73ba4c8460 Bumpy mcbumpface 2024-05-13 22:50:05 -05:00
Matt Godbolt
4d777d3056 It's that time again 2024-04-29 22:04:04 -05:00
Matt Godbolt
f358067cec Migrate to eslint-plugin-n; as ...-node is deprecated (#6387)
Replaces #6310
2024-04-23 06:45:55 -05:00
Matt Godbolt
384479669e The bumpination 2024-04-22 22:02:38 -05:00
Matt Godbolt
e47f9fc52e Time to bump the webpack version 2024-03-09 13:42:28 -06:00
Matt Godbolt
5c3d605b8e Bump the webpack hack 2024-02-12 22:12:59 -06:00
Andrea Tomasi
1cacc9ce79 Add Elixir language support (#6081)
Hi, I am adding support for the Elixir language
(https://github.com/compiler-explorer/compiler-explorer/issues/3947)
I have done this so far. It is not perfect but at least is something I
can work with.
 
In Elixir you can write several modules in the same file, so I show the
different compile utins as a list.

It works locally but I don't know how to add the Elixir language to
[infra](https://github.com/compiler-explorer/infra/)

Some notes:
- I think Elixir's macro system may be a potential security issue
because I can run code during compilation.
- The decompiled code contains a reference to the file path on the
system machine.


![elixir_compiler](https://github.com/compiler-explorer/compiler-explorer/assets/11353602/59e46c98-646d-4275-9c03-e4097a4977ef)
2024-02-05 20:54:01 -06:00
Matt Godbolt
61b979cd58 Update all the minor packages; reformat and bump (#6064)
Formats all the things too.
2024-01-29 21:37:48 -06:00
Matt Godbolt
4256d42916 Various updates (#6007)
Even more mechanical updates.
2024-01-15 18:31:46 -06:00
Matt Godbolt
8516801eb6 Bump the webpack number 2024-01-15 15:47:53 -06: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
partouf
3bc7ff606d webpackthingymabob 2024-01-01 17:57:59 +01:00
Matt Godbolt
359c0f4a80 New version of the webpack stuff 2023-12-18 20:58:02 -06:00
Matt Godbolt
aa786bd0ef Update deps, format, lint, bump workaround version 2023-12-03 17:30:50 -06:00
Matt Godbolt
af48507e57 Upgrade all the things (#5737)
- npm upgrade
- npm install latest sonarjs (which was "breaking" semantically but
didn't seem to be)
- bump the js webpack version out of paranoia
- test
- run lint and format
2023-11-12 15:01:40 -06:00
Matt Godbolt
d5ad21126b Bumpy 2023-10-08 18:32:37 -05:00
Matt Godbolt
1fc878d7a2 Bump all the things forward (#5563)
also run the lint and format nonsense
2023-10-05 21:43:33 -05:00
Matt Godbolt
7aa313e08b Bump the version number for webpack 2023-09-06 20:37:30 -05:00
Matt Godbolt
d2a6dc251d Update remaining packages and pre-emptively bump the .vXX hack; reformat 2023-08-15 22:35:24 -05:00
Matt Godbolt
17398b8755 Bump the v thing. Arg 2023-08-07 22:45:21 -05:00
Matt Godbolt
488eeb600b Update to Monaco 0.40.0 (#5287)
Also hopefully fixes the issue where when we bump monaco versions we get
build errors.
2023-07-25 22:35:47 -05:00
Matt Godbolt
fdea51fc80 Update all the latest minor things (#5288) 2023-07-25 22:23:42 -05:00
Matt Godbolt
75a4c7441d Bump all the packages etc (#5261) 2023-07-15 10:45:01 -05:00
Matt Godbolt
87024e2239 Bump latest deps (#5252) 2023-07-10 21:31:04 -05:00
Patrick Quist
5be4d91162 update version 2023-06-30 08:41:58 +01:00
Matt Godbolt
55cd371404 Bump version of webpack hack 2023-06-28 16:49:01 +01:00
Matt Godbolt
1e98f6ccc3 Update all the minor dependencies (#5184) 2023-06-21 18:11:43 +02:00
Matt Godbolt
214e48262b Bump all deps (#5114)
- npm update
- bump the webpack version as usually that needs it
- re-run eslint
- re-run format
2023-06-06 20:56:10 -05:00
Matt Godbolt
362ebf7a57 npm update and bump; run all the formatters and linters (#4984) 2023-04-21 18:25:57 -05:00