Skip to content

Commit c388116

Browse files
committed
Fully remove dynamicImportCompat
1 parent da5cddf commit c388116

File tree

7 files changed

+5
-1311
lines changed

7 files changed

+5
-1311
lines changed

Gulpfile.js

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,12 @@ function getCopyrightHeader() {
164164
* @param {boolean} exportIsTsObject True if this file exports the TS object and should have relevant code injected.
165165
*/
166166
function esbuildTask(entrypoint, outfile, exportIsTsObject = false) {
167-
const preBabel = `${outfile}.tmp.js`;
168-
169167
/** @type {esbuild.BuildOptions} */
170168
const options = {
171169
entryPoints: [entrypoint],
172170
banner: { js: getCopyrightHeader() },
173171
bundle: true,
174-
outfile: preBabel,
172+
outfile,
175173
platform: "node",
176174
// TODO: also specify minimal browser targets
177175
target: "node10", // Node 10 is the oldest benchmarker.
@@ -208,19 +206,12 @@ function esbuildTask(entrypoint, outfile, exportIsTsObject = false) {
208206

209207
// TODO: these need to have better function names, for gulp.
210208
return {
211-
build: async () => {
212-
await esbuild.build(options);
213-
await exec(process.execPath, ["./node_modules/@babel/cli/bin/babel.js", preBabel, "--out-file", outfile, "--plugins", "@babel/plugin-transform-block-scoping", "--compact", "false", "--source-maps"]);
214-
await del([preBabel, `${preBabel}.map`]);
215-
},
209+
build: () => esbuild.build(options),
216210
clean: () => del([outfile, `${outfile}.map`]),
217211
watch: () => esbuild.build({ ...options, watch: true }),
218212
};
219213
}
220214

221-
// TODO(jakebailey): Add this function to the non-bundle paths which
222-
// don't output to the correct location. (e.g., not dynamicImportCompat).
223-
224215
/**
225216
* Creates a function that writes a CJS module that reexports another CJS file via
226217
* `module.exports = require("...")`.
@@ -293,33 +284,25 @@ task("watch-services").flags = {
293284
" --built": "Compile using the built version of the compiler."
294285
};
295286

296-
const buildDynamicImportCompat = () => buildProject("src/dynamicImportCompat");
297-
task("dynamicImportCompat", buildDynamicImportCompat);
298-
299-
const cleanDynamicImportCompat = () => cleanProject("src/dynamicImportCompat");
300-
const watchDynamicImportCompat = () => watchProject("src/dynamicImportCompat");
301-
302287

303288
const esbuildServer = esbuildTask("./src/tsserver/server.ts", "./built/local/tsserver.js", /* exportIsTsObject */ true);
304289

305-
const buildServerMain = () => cmdLineOptions.bundle ? esbuildServer.build() : buildProject("src/tsserver");
306-
const buildServer = series(buildDynamicImportCompat, buildServerMain);
290+
const buildServer = () => cmdLineOptions.bundle ? esbuildServer.build() : buildProject("src/tsserver");
307291
buildServer.displayName = "buildServer";
308292
task("tsserver", series(preBuild, buildServer));
309293
task("tsserver").description = "Builds the language server";
310294
task("tsserver").flags = {
311295
" --built": "Compile using the built version of the compiler."
312296
};
313297

314-
const cleanServerMain = () => cmdLineOptions.bundle ? esbuildServer.clean() : cleanProject("src/tsserver");
315-
const cleanServer = series(cleanDynamicImportCompat, cleanServerMain);
298+
const cleanServer = () => cmdLineOptions.bundle ? esbuildServer.clean() : cleanProject("src/tsserver");
316299
cleanServer.displayName = "cleanServer";
317300
cleanTasks.push(cleanServer);
318301
task("clean-tsserver", cleanServer);
319302
task("clean-tsserver").description = "Cleans outputs for the language server";
320303

321304
const watchServer = () => cmdLineOptions.bundle ? esbuildServer.watch() : watchProject("src/tsserver");
322-
task("watch-tsserver", series(preBuild, parallel(watchLib, watchDiagnostics, watchDynamicImportCompat, watchServer)));
305+
task("watch-tsserver", series(preBuild, parallel(watchLib, watchDiagnostics, watchServer)));
323306
task("watch-tsserver").description = "Watch for changes and rebuild the language server only";
324307
task("watch-tsserver").flags = {
325308
" --built": "Compile using the built version of the compiler."
@@ -591,7 +574,6 @@ const produceLKG = async () => {
591574
"built/local/typescriptServices.js",
592575
"built/local/typescriptServices.d.ts",
593576
"built/local/tsserver.js",
594-
"built/local/dynamicImportCompat.js",
595577
"built/local/typescript.js",
596578
"built/local/typescript.d.ts",
597579
"built/local/tsserverlibrary.js",

0 commit comments

Comments
 (0)