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

Delete test-gc-sweep-tests #15943

Merged
merged 2 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ module.exports = {
"prefer-arrow-callback": "off",
"@typescript-eslint/strict-boolean-expressions": "off", // requires strictNullChecks=true in tsconfig
"import/no-nodejs-modules": "off",
// ESLint's resolver doesn't resolve relative imports of ESNext modules correctly, since
// it resolves the path relative to the .ts file (and assumes a file with a .js extension
// should exist there)
"import/no-unresolved": ["error", { ignore: ["^\\.(.*)\\.js$"] }],
},
parserOptions: {
project: ["./src/test/tsconfig.json"],
Expand Down
1 change: 1 addition & 0 deletions packages/test/test-gc-sweep-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"type": "module",
Abe27342 marked this conversation as resolved.
Show resolved Hide resolved
"scripts": {
"build": "fluid-build . --task build",
"build:compile": "fluid-build . --task compile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { makeRandom } from "@fluid-internal/stochastic-test-utils";
import { DataObjectFactory } from "@fluidframework/aqueduct";
import { assert, delay } from "@fluidframework/common-utils";
import { SharedCounter } from "@fluidframework/counter";
import { DataObjectWithCounter, dataObjectWithCounterFactory } from "./dataObjectWithCounter";
import { DataObjectWithCounter, dataObjectWithCounterFactory } from "./dataObjectWithCounter.js";

/**
* A root dataObject that repeatedly sends a series of ops, and then references a new child or
Expand Down
10 changes: 5 additions & 5 deletions packages/test/test-gc-sweep-tests/src/test/autoRunTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import {
import { IContainerRuntimeBase } from "@fluidframework/runtime-definitions";
import { makeRandom } from "@fluid-internal/stochastic-test-utils";
import { delay } from "@fluidframework/common-utils";
import { mockConfigProvider } from "../mockConfigProvider";
import { IgnoreErrorLogger } from "../ignoreErrorLogger";
import { ContainerManager } from "../containerManager";
import { rootDataObjectWithChildDataObjectFactory } from "../dataObjectWithChildDataObject";
import { dataObjectWithCounterFactory } from "../dataObjectWithCounter";
import { mockConfigProvider } from "../mockConfigProvider.js";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if this would lose typing info for intellisense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. Typescript looks for .d.ts files adjacent to the js file when using an import statement from an esnext module. You can see their doc has similar syntax.

Overall, my impression is that the ecosystem is a lot more mature w.r.t. supporting fully qualified import paths than the last time I checked. E.g. the changes I had to make to webflow's webpack config to make it understand this import were pretty trivial:

				// This ensures that webpack understands fully-specified relative module imports.
				// See https://github.com/webpack/webpack/issues/13252 for more discussion.
				extensionAlias: {
					".js": [".ts", ".tsx", ".js"],
					".mjs": [".mts", ".mtsx", ".mjs"],
				},

The 2 biggest issues I encountered which I don't have ideal solutions for were:

  1. VSCode will generate incorrect autocomplete imports. This behavior is configurable via "typescript.preferences.importModuleSpecifierEnding", but I don't think there's a way to tell VSCode to scope the setting to particular subsets of our repo. This issue would go away if we ever convert to full ESNext modules only (which is probably a ways off).
  2. I turned off ESLint's "import/no-unresolved" rule for relative imports. We could fix this if we wrote our own ESLint import resolver, but I didn't find one that worked out of the box and IMO the maintenance burden is probably not worth the value the lint rule provides for relative imports.

import { IgnoreErrorLogger } from "../ignoreErrorLogger.js";
import { ContainerManager } from "../containerManager.js";
import { rootDataObjectWithChildDataObjectFactory } from "../dataObjectWithChildDataObject.js";
import { dataObjectWithCounterFactory } from "../dataObjectWithCounter.js";

describeNoCompat("GC InactiveObjectX tests", (getTestObjectProvider) => {
let provider: ITestObjectProvider;
Expand Down
1 change: 1 addition & 0 deletions packages/test/test-gc-sweep-tests/src/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"rootDir": "../",
"outDir": "../../dist",
"types": ["mocha", "@fluidframework/test-driver-definitions"],
"module": "esnext",
},
"include": ["./**/*", "../*"],
}