Unverified Commit e65e7363 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: Commit changed generated bindings types (#72452)

This should have been part of #70998 when the Rust NAPI function were
removed


Closes PACK-3415
parent 7dc7be20
...@@ -370,15 +370,6 @@ export interface NapiRewrite { ...@@ -370,15 +370,6 @@ export interface NapiRewrite {
has?: Array<NapiRouteHas> has?: Array<NapiRouteHas>
missing?: Array<NapiRouteHas> missing?: Array<NapiRouteHas>
} }
export function createTurboTasks(
outputPath: string,
persistentCaching: boolean,
memoryLimit?: number | undefined | null
): ExternalObject<NextTurboTasks>
export function runTurboTracing(
options: Buffer,
turboTasks: ExternalObject<NextTurboTasks>
): Promise<Array<string>>
export function getTargetTriple(): string export function getTargetTriple(): string
export function initHeapProfiler(): ExternalObject<RefCell> export function initHeapProfiler(): ExternalObject<RefCell>
export function teardownHeapProfiler( export function teardownHeapProfiler(
......
...@@ -23,10 +23,8 @@ import { ...@@ -23,10 +23,8 @@ import {
import { getReactCompilerLoader } from '../get-babel-loader-config' import { getReactCompilerLoader } from '../get-babel-loader-config'
import { TurbopackInternalError } from '../../server/dev/turbopack-utils' import { TurbopackInternalError } from '../../server/dev/turbopack-utils'
import type { import type {
ExternalObject,
NapiPartialProjectOptions, NapiPartialProjectOptions,
NapiProjectOptions, NapiProjectOptions,
NextTurboTasks,
} from './generated-native' } from './generated-native'
import type { import type {
Binding, Binding,
...@@ -1054,18 +1052,6 @@ async function loadWasm(importPath = '') { ...@@ -1054,18 +1052,6 @@ async function loadWasm(importPath = '') {
return undefined return undefined
}, },
turbo: { turbo: {
startTrace() {
Log.error('Wasm binding does not support trace yet')
},
createTurboTasks: function (
_outputPath: string,
_persistentCaching: boolean,
_memoryLimit?: number | undefined
): ExternalObject<NextTurboTasks> {
throw new Error(
'`turbo.createTurboTasks` is not supported by the wasm bindings.'
)
},
createProject: function ( createProject: function (
_options: ProjectOptions, _options: ProjectOptions,
_turboEngineOptions?: TurboEngineOptions | undefined _turboEngineOptions?: TurboEngineOptions | undefined
...@@ -1233,24 +1219,6 @@ function loadNative(importPath?: string) { ...@@ -1233,24 +1219,6 @@ function loadNative(importPath?: string) {
initHeapProfiler: bindings.initHeapProfiler, initHeapProfiler: bindings.initHeapProfiler,
teardownHeapProfiler: bindings.teardownHeapProfiler, teardownHeapProfiler: bindings.teardownHeapProfiler,
turbo: { turbo: {
startTrace(options = {}, turboTasks: ExternalObject<NextTurboTasks>) {
initHeapProfiler()
return (customBindings ?? bindings).runTurboTracing(
toBuffer({ exact: true, ...options }),
turboTasks
)
},
createTurboTasks(
outputPath: string,
persistentCaching: boolean,
memoryLimit?: number
): ExternalObject<NextTurboTasks> {
return bindings.createTurboTasks(
outputPath,
persistentCaching,
memoryLimit
)
},
createProject: bindingToApi(customBindings ?? bindings, false), createProject: bindingToApi(customBindings ?? bindings, false),
startTurbopackTraceServer(traceFilePath) { startTurbopackTraceServer(traceFilePath) {
Log.warn( Log.warn(
......
import type { NextConfigComplete } from '../../server/config-shared' import type { NextConfigComplete } from '../../server/config-shared'
import type { __ApiPreviewProps } from '../../server/api-utils' import type { __ApiPreviewProps } from '../../server/api-utils'
import type { import type { ExternalObject, RefCell } from './generated-native'
ExternalObject,
NextTurboTasks,
RefCell,
} from './generated-native'
export interface Binding { export interface Binding {
isWasm: boolean isWasm: boolean
turbo: { turbo: {
startTrace(options: any, turboTasks: ExternalObject<NextTurboTasks>): any
createTurboTasks(
outputPath: string,
persistentCaching: boolean,
memoryLimit?: number
): ExternalObject<NextTurboTasks>
createProject( createProject(
options: ProjectOptions, options: ProjectOptions,
turboEngineOptions?: TurboEngineOptions turboEngineOptions?: TurboEngineOptions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment