feat(napi/oxlint): read source text into start of allocator#12122
Merged
graphite-app[bot] merged 1 commit intomainfrom Jul 9, 2025
Merged
Conversation
This was referenced Jul 7, 2025
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #12122 will not alter performanceComparing Summary
|
47026ff to
b12e85e
Compare
e40153a to
78cf55f
Compare
b12e85e to
e7d7ff7
Compare
78cf55f to
6d5588c
Compare
e7d7ff7 to
312d645
Compare
Member
Author
|
The tests added in #12149 still pass after this change, so it doesn't seem to have broken anything. |
312d645 to
d1871fd
Compare
6d5588c to
8d710a2
Compare
d1871fd to
ebf648e
Compare
Contributor
Merge activity
|
In `napi/oxlint2`, read source text into start of allocator, instead of end. This is what raw transfer needs. The implementation here is a complete dog's dinner! In order to inject this code into `oxlint` library code without affecting the behavior of existing `oxlint` app, it uses `oxlint2` feature to changes the allocator's behavior. There is also way too much unsafe code for comfort. Much of the code in this PR can be removed again when we replace `bumpalo` with our own allocator, because that allocator will allocate all strings at start of the arena by default anyway. So I propose that we accept this mess as a temporary solution just to get us to a working prototype, and then clean it up in next couple of weeks.
ebf648e to
152e59d
Compare
graphite-app bot
pushed a commit
that referenced
this pull request
Jul 9, 2025
Big endian tests were failing on CI. This is due to a strange combination of cargo features getting enabled in the tests, causing problems in linter crates, since #12122. I don't entirely understand how this was happening, but running the tests with `cross test --all-features` fixes it. In any case, we do want to run tests for all features on big endian.
This was referenced Jul 12, 2025
camc314
added a commit
that referenced
this pull request
Jul 16, 2025
## [1.7.0] - 2025-07-16 ### 🚀 Features - 5e428a4 linter/eslint-plugin-next: No-html-link-for-pages rule addition (#12194) (Gabriel Díaz Aguilera) - 9b14fbc ast: Add `ThisExpression` to `TSTypeName` (#12156) (Boshen) - c551b8f linter: Report diagnostics from custom plugins (#12219) (camc314) - d387729 linter: JS custom rules config (#12160) (camc314) - 152e59d napi/oxlint: Read source text into start of allocator (#12122) (overlookmotel) - bde1ef1 linter: Load custom JS plugins (#11980) (camc314) - d4ebd14 linter: Add `oxlint2`/`disable_oxlint2` feature flags (#12130) (camc314) - a4dae73 linter: Introduce `LintPlugins` to store builtin + custom plugins (#12117) (camc314) ### 🐛 Bug Fixes - 3f9a1f0 linter/no-unused-private-class-members: Fix false positive with nullish coalescing assignments (#12317) (camc314) - 47fad0e linter/no-empty-file: False positive with empty file with triple slash directive (#12293) (camc314) - 633ba30 linter: False positive with unknown plugins when unmatched eslint rule (#12285) (camc314) - 9720774 linter: Report implicit config parse errors (#12260) (Simon Buchan) - 1920c6b language_server: Respect the root `.oxlintrc.json` file for `ignorePatterns` (#12171) (Sysix) - 98708eb linter: Fix inconsistent behavior in `no-duplicate-imports` rule (#12192) (yefan) - 853d2bc linter, language_server: Correctly identify usage of `import` plugin (#12157) (overlookmotel) ### 🚜 Refactor - ee761de ast: Remove `AstKind` for `AssignmentTarget` (#12252) (Tyler Earls) - c68b607 ast: Rename `TemplateLiteral::quasi` to `TemplateLiteral::single_quasi` (#12266) (Dunqing) - 32c32af ast: Check whether there is a single `quasi` in `TemplateLiteral::quasi` (#12265) (Dunqing) - 8f6a1da linter/js-plugins: Use `u32` for IDs (#12243) (overlookmotel) - 36cd364 linter/js-plugins: Clean up code (#12242) (overlookmotel) - 8c02ebd linter/js-plugins: Rename `specifiers` to `paths` (#12241) (overlookmotel) - 3adaf98 linter: Simplify getting nodes count (#12239) (overlookmotel) - 6e54645 language_server: Store `LintService` instead of `Linter` (#12016) (Sysix) - 113cf8c linter: Move `LintServiceOptions.paths` to `LintService.with_paths` (#12015) (Sysix) - acfac68 oxlint: Adjust ignore patterns by counting bytes instead of chars (#12209) (Sysix) - 729b82b linter: Rename `plugin_name` to `plugin_specifier` (#12148) (overlookmotel) - 532b816 linter: Use `to_string` instead of `into` (#12147) (overlookmotel) - 89f2a69 linter: TODO comment (#12146) (overlookmotel) - f90d3e1 linter: Feature gate `load_external_plugin` by both `oxlint2` and `disable_oxlint2` features (#12141) (overlookmotel) - 12e4ec7 linter: Make `tokio` dependency optional (#12140) (overlookmotel) - 1d2eaca oxlint2: Introduce `force_test_reporter` feature for consistent graphical outputs (#12133) (camc314) - 8814c53 ast: Remove `AstKind` for `PropertyKey` (#12108) (camchenry) - 228cff5 semantic,linter: Assert that Program is always the first node (#12123) (Ulrich Stark) - e8e2a25 ast: Remove `AstKind` for `AssignmentTargetPattern` (#12105) (camchenry) - f7c675d linter: Rename `LintPlugins` to `BuiltinLintPlugins` (#12116) (camc314) - a9e5ec0 linter: Access plugins through config instead of storing directly (#12115) (camc314) - 9736a7f linter: Simplify `unicorn/require-post-message-target-origin` (#12110) (shulaoda) ### 📚 Documentation - 2e3db46 linter: Add missing backtick preventing website from building (#12113) (camc314) ### ⚡ Performance - d0f8b88 linter/js-plugins: Do not copy `Vec` (#12248) (overlookmotel) - 4284d19 linter/js-plugins: Use hashmap `Entry` API + remove temp `Vec` (#12247) (overlookmotel) - c7889c3 semantic,linter: Simplify implementation and uses of ancestors iterators (#12164) (Ulrich Stark) - f99959c linter: Move work out of loop (#12145) (overlookmotel) - 514d40c linter: Do not create `Resolver` unless required (#12142) (overlookmotel) - 7103527 linter/no-constructor-return: Optimize loop (#12138) (overlookmotel) ### 🧪 Testing - d1194e8 oxlint: Ignore test on windows (#12262) (camc314) Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In
napi/oxlint2, read source text into start of allocator, instead of end. This is what raw transfer needs.The implementation here is a complete dog's dinner! In order to inject this code into
oxlintlibrary code without affecting the behavior of existingoxlintapp, it usesoxlint2feature to changes the allocator's behavior.There is also way too much unsafe code for comfort. Much of the code in this PR can be removed again when we replace
bumpalowith our own allocator, because that allocator will allocate all strings at start of the arena by default anyway.So I propose that we accept this mess as a temporary solution just to get us to a working prototype, and then clean it up in next couple of weeks.