Thanks to visit codestin.com
Credit goes to github.com

Skip to content

New tnf crate in rust #70

@sorrycc

Description

@sorrycc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions