* Minor updates only
* Added explicit radix parameter (10) to all Number.parseInt() calls throughout the codebase (new lint rule)
* Updated several @ts-ignore comments to @ts-expect-error for better TypeScript practices (new lint rule)
* Removed unnecessary @ts-ignore comments in some mode files (ditto)
* Used "none return" based arrow functions for some map stuff
* Replaced a `map()` call that didn't return anything to a for() loop
* Fixed up some cypress stuff, noting work for the future
- 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.
Remove most, if not all, of the synchronous file reads. Hopefully this
will help a little with performance and "event loop lag". Mostly, it's
"try not to use third party packages when builtins now do the work".
Local testing seems OK - but needs a good poke around on staging to
exercise all the paths.
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.
We _once_ saw a local file that had an extra `}` at the end and the
vague hypothesis is because it was cached multiple times at once (it was
a shared executable for clang++) then _sometimes_ it was one char longer
than another run, and two runs at the same time wrote to the same temp
file, and the last byte from the "longer run" was left...
- use async file access when looking for llc
- don't use the random customCwd in the cache hash
- don't lookup "log cache accesses" in props every access
- turn on compiler cache access logging in discovery mode
- error on missing wine executable config
- atomically cache on disk file cache
We're not using the new `send` functionality, but this gets everything
running and tests passing. It has _not_ been tested against real AWS
yet. That's next. I might move stuff over to the new `send` API, but
also I might not if it's just working.
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>
- latest sentry, tar-stream, which, some yamljs versions
- latest eslint-* stuff
- latest webpack manifest
- Applies all the automatic fixes for newer lint rules
- Bump the webpack version
applies new tslint stuff
The largest changes here are:
- enforcing single quotes for strings
- enforcing trailing commas where possible
In addition to those we have enabled several eslint plugins:
- plugin:requirejs/recommended, to enforce some conventions in require statements
- plugin:node/recommended, to enforce correct usage of various node.js APIs
- plugin:unicorn/recommended, which contains a pretty mixed bag of useful rules
This PR attempts to not change code behavior when possible. In cases where fixing
existing code would change semantics, a linting exclusion has been placed in the
code base to silence the error. You can find these by searching for `eslint-disable-next-line`.
Co-authored-by: Austin Morton <austinpmorton@gmail.com>
When setting a key, the file is written to disk first and then
the cache entry is set. When the key already exists, the dispose
callback will end up deleting the *updated* file from disk.
This results in a cache entry with no corresponding file on disk.
There appears to be a race condition between key eviction
and access. It is possible for the file to be deleted from disk,
but the key to still be in the cache momentarily.
If someone tries to access the key during this period a
file not found error will be thrown, and odd behavior may
occur in the caller.
Instead, we catch/log errors and return a cache miss.
This commit adds support for hosting on windows, as well as better
support for the Visual C++ compiler. Specific interesting changes are:
- switch from /FAsc to /FA
- order functions in file order
- support demangling win32-style identifiers with undname
- clang++ and vc++ on win32 host are both supported
Due to concerns over status of upstream
Cookie consent value is now tied to hash of cookie privacy text,
so we get automatic revoking of consent on privacy update