From 7cd946de1c0bfdba5557400235fcbe772eec0333 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sat, 16 Nov 2024 11:47:21 +0100 Subject: [PATCH] Remove unused ts-loader This has not been used since commit 4d23d00456 in July 2020, and the version of ts-loader used does not have webpack 5 support. Rather than upgrading the version of an unused dependency, remove it. Refs #6998 --- CHANGES.md | 1 + buildprocess/configureWebpack.js | 23 +---------------------- lib/Models/Definition/CreateModel.ts | 23 ----------------------- package.json | 1 - yarn.lock | 15 ++------------- 5 files changed, 4 insertions(+), 59 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 26c5cf42b6f..508ae83d0be 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ #### next release (8.7.10) +- Remove unused ts-loader dependency. - [The next improvement] #### 8.7.9 - 2024-11-22 diff --git a/buildprocess/configureWebpack.js b/buildprocess/configureWebpack.js index 57978564483..b2798cd78b2 100644 --- a/buildprocess/configureWebpack.js +++ b/buildprocess/configureWebpack.js @@ -178,30 +178,9 @@ function configureWebpack( path.resolve(terriaJSBasePath, "buildprocess", "generateCatalogIndex.ts"), path.resolve(terriaJSBasePath, "buildprocess", "patchNetworkRequests.ts") ], - use: [ - babelLoader - // Re-enable this if we need to observe any differences in the - // transpilation via ts-loader, & babel's stripping of types, - // or if TypeScript has newer features that babel hasn't - // caught up with - // { - // loader: 'ts-loader', - // options: { - // transpileOnly: true - // } - // } - ] + use: [babelLoader] }); - // config.module.loaders.push({ - // test: /\.(ts|js)$/, - // include: [ - // path.resolve(terriaJSBasePath, 'lib'), - // path.resolve(terriaJSBasePath, 'test') - // ], - // loader: require.resolve('ts-loader') - // }); - // Use the raw loader for our view HTML. We don't use the html-loader because it // will doing things with images that we don't (currently) want. config.module.rules.push({ diff --git a/lib/Models/Definition/CreateModel.ts b/lib/Models/Definition/CreateModel.ts index 0eae3577274..dc689b91bd2 100644 --- a/lib/Models/Definition/CreateModel.ts +++ b/lib/Models/Definition/CreateModel.ts @@ -42,29 +42,6 @@ export default function CreateModel>( readonly TraitsClass: TraitsConstructor> = Traits as any; readonly strata: Map; - /** - * Babel transpiles this & correctly assigns undefined to this property as - * under `proposal-class-fields` declaring a property without initialising - * it still declares it, thus treated as - * - * `sourceReference = undefined;` - * >This differs a bit from certain transpiler implementations, which would - * >just entirely ignore a field declaration which has no initializer. - * - * instead of what we had expected with TypeScript's treatment of this class - * property being: - * `readonly sourceReference: BaseModel | undefined;` - * - * whereas ts-loader strips the type completely along with the implicit - * undefined assignment getting removed entirely before it hits - * babel-loader, side-stepping this case. - * - * Given we don't actually do anything different to the main constructor - * call in `BaseModel`, it feels more correct to remove this annotation - * rather than declare it here + re-assigning it in the `Model` constructor - */ - // readonly sourceReference: BaseModel | undefined; - /** * Gets the uniqueIds of models that are known to contain this one. * This is important because strata sometimes flow from container to diff --git a/package.json b/package.json index 38c039531d6..93e9bf15adf 100644 --- a/package.json +++ b/package.json @@ -180,7 +180,6 @@ "terriajs-tiff-imagery-provider": "2.13.3", "thredds-catalog-crawler": "0.0.7", "ts-essentials": "^5.0.0", - "ts-loader": "^5.3.3", "typescript": "~5.2.0", "urijs": "^1.18.12", "url-loader": "^1.1.2", diff --git a/yarn.lock b/yarn.lock index c1a9ee93eee..ccdd99285d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5288,7 +5288,7 @@ engine.io@~6.5.2: engine.io-parser "~5.2.1" ws "~8.11.0" -enhanced-resolve@^4.0.0, enhanced-resolve@^4.5.0: +enhanced-resolve@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz#2f3cfd84dbe3b487f18f2db2ef1e064a571ca5ec" integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg== @@ -11011,7 +11011,7 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.3.0, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -12210,17 +12210,6 @@ ts-essentials@^5.0.0: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-5.0.0.tgz#531d590c9cd62652c9d96284904cbdb2a1dd5ca8" integrity sha512-ftKWOm6Jq+/UCBekDfxUjLODEd5XGN2EM/+TIQV9LJ5xSV12je4GqdRyv7pXXGGYmEt/nQa6F00xTWYJ5PMjIQ== -ts-loader@^5.3.3: - version "5.4.5" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-5.4.5.tgz#a0c1f034b017a9344cef0961bfd97cc192492b8b" - integrity sha512-XYsjfnRQCBum9AMRZpk2rTYSVpdZBpZK+kDh0TeT3kxmQNBDVIeUjdPjY5RZry4eIAb8XHc4gYSUiUWPYvzSRw== - dependencies: - chalk "^2.3.0" - enhanced-resolve "^4.0.0" - loader-utils "^1.0.2" - micromatch "^3.1.4" - semver "^5.0.1" - ts-toolbelt@^6.4.2: version "6.15.5" resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-6.15.5.tgz#cb3b43ed725cb63644782c64fbcad7d8f28c0a83"