Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tnf crate in rust #70

Open
sorrycc opened this issue Nov 26, 2024 · 0 comments
Open

New tnf crate in rust #70

sorrycc opened this issue Nov 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sorrycc
Copy link
Member

sorrycc commented Nov 26, 2024

Problem

We need to do some heavy-cpu tasks with Rust, the first of which is to accurately collect project meta-information, with support of watch.

Solution

How?

  1. New tnf and tnf_binding in crates directory, new tnf-binding in packages directory (package name @umijs/tnf-binding)
  2. export a build and an update method.
export function build(opts: {
  entry: Record<string, string>,
  alias: [[string, string]],
  externals: Record<string, string>,
}): {
  files: {
    path: string,
    code: string,
    imports: {
      source: string,
      loc: any,
      default: string,
      namespace: string,
      specifiers: Record<string, { name: string, kind: any }>,
    }[],
    exports: any[],
  }[]
}

export function update(opts: {
  changes: {
    path: string,
    type: any,
  }[]
}): { changes: files: {...}[] }

3、try to use oxc instead of swc

Alternatives

No response

Importance

i cannot use TNF without it

Additional Information

No response

@sorrycc sorrycc added the enhancement New feature or request label Nov 26, 2024
@sorrycc sorrycc changed the title New tnf crate in rust new tnf crate in rust Nov 26, 2024
@sorrycc sorrycc changed the title new tnf crate in rust New tnf crate in rust Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant