oxc/napi/parser/Cargo.toml
burlinchen 38e7351a91
chore(napi): Refactor async parsing functions to remove tokio dependency (#4049)
Resolves #4044
- Added `use napi::{bindgen_prelude::AsyncTask, Task}` to handle async
tasks without tokio.
- Introduced `ResolveTask` struct implementing `Task` for asynchronous
parsing.
- Replaced `parse_sync` function implementation with `parse_with_return`
to reuse code.
- Refactored `parse_async` to use `AsyncTask` and `ResolveTask` for
async parsing.
- Removed tokio dependency by avoiding `tokio::spawn` and using
`AsyncTask` for async operations.

This refactor enhances code readability and removes the dependency on
tokio, streamlining the async task handling within the napi framework.
2024-07-04 20:31:19 +08:00

39 lines
1,021 B
TOML

[package]
name = "oxc_parser_napi"
version = "0.0.0"
publish = false
authors.workspace = true
description.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
categories.workspace = true
[lints]
workspace = true
[lib]
crate-type = ["cdylib"]
test = false
doctest = false
[dependencies]
oxc_allocator = { workspace = true }
oxc_parser = { workspace = true }
oxc_ast = { workspace = true, features = ["serialize"] }
oxc_span = { workspace = true }
oxc_diagnostics = { workspace = true }
oxc_module_lexer = { path = "../../crates/oxc_module_lexer" }
napi = { workspace = true, features = ["async"] }
napi-derive = { workspace = true }
serde_json = { workspace = true }
[package.metadata.cargo-shear]
ignored = ["napi"]
[build-dependencies]
napi-build = { workspace = true }