-
Notifications
You must be signed in to change notification settings - Fork 53
chore: Remove src, test, build, docs path aliases #2233
Conversation
import { mountWithProviderAndGetComponent, mountWithProvider } from 'test/utils' | ||
import { UIComponent } from 'src/utils' | ||
import { mountWithProviderAndGetComponent, mountWithProvider } from '../../utils' | ||
import { UIComponent } from '@fluentui/react/src/utils' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { UIComponent } from '@fluentui/react/src/utils' | |
import { UIComponent } from '../../src/utils' |
Can we use instead for unexported things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's kind of strange to have a combination of relative path imports and package name imports into the same code, and it might not be clear to a developer coming into the code which import type to use when. (Though you could make the same argument about clarity with when to use @fluentui/react
vs paths like @fluentui/react/src/whatever
.)
import { mountWithProvider } from 'test/utils' | ||
import { Props, PropsOf, InstanceOf } from 'src/types' | ||
import { mountWithProvider } from '../../utils' | ||
import { Props, PropsOf, InstanceOf } from '@fluentui/react/src/types' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Props, PropsOf, InstanceOf } from '@fluentui/react/src/types' | |
import { Props, PropsOf, InstanceOf } from '../../src/types' |
Same thing...
packages/react/test/specs/commonTests/implementsWrapperProp.tsx
Outdated
Show resolved
Hide resolved
build/tsconfig.docs.json
Outdated
@@ -3,10 +3,7 @@ | |||
"compilerOptions": { | |||
"module": "esnext", | |||
"paths": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paths
can be removed there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please also check include
. I don't think that we should include react
anymore
This reverts commit 26b95d0.
0ff4a1d
to
e17385f
Compare
I think it was somehow introduced by this set of changes...not sure how. I'm going to work on getting an isolated repro. |
Closing this down and splitting the changes. |
Replace legacy path aliases with more standard imports:
src
with@fluentui/react
everywhere.@fluentui/react/src
. I don't think this should create problems since those imports are only used in tests and docs, but please let me know if that's wrong.test
with relative pathsbuild
with relative paths (a couple to be changed to@fluentui/internal-tooling
once chore: Everybody gets a package #2218 is done)docs
indocs
project with relative pathsbuild/gulp/plugins/util
import fromdocs/src/types
. For now, add a file in that directory which re-exports the types (imported by relative path) and update all imports to be from that file. Eventually the types should move to a shared location.docs
imports inperf
andperf-test
with relative path imports, to be removed once the@fluentui/docs
package is added in chore: Everybody gets a package #2218react
andaccessibility
import generated files which currently live underdocs
(componentInfo
,behaviorInfo
). These imports have to stay as path imports for now because having those packages depend on@fluentui/docs
would cause circular imports. So we need a better all-up solution for where these generated files and/or the tests that rely on them should live (or get rid of the generated files?).