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

Add baseUrl documentation #6847

Merged
merged 4 commits into from Apr 19, 2019

Conversation

@ianschmitz
Copy link
Collaborator

commented Apr 19, 2019

@ianschmitz ianschmitz added this to the 3.0 milestone Apr 19, 2019

@ianschmitz ianschmitz requested review from amyrlam and iansu as code owners Apr 19, 2019

@ianschmitz ianschmitz added this to In progress in v3 via automation Apr 19, 2019

Show resolved Hide resolved docusaurus/docs/importing-a-component.md Outdated
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src/**/*"]

This comment has been minimized.

Copy link
@iansu

iansu Apr 19, 2019

Collaborator

I don't think this is needed. I could definitely be wrong about that though. When I was testing this I wasn't using it.

This comment has been minimized.

Copy link
@ianschmitz

ianschmitz Apr 19, 2019

Author Collaborator

You definitely don't need it, you're right. It's recommended by VS Code team to avoid performance issues when you add this file. This link explains it well: https://code.visualstudio.com/docs/languages/jsconfig. The key thing to note:

If you do not have a jsconfig.json in your workspace, VS Code will by default exclude the node_modules folder.

When your JavaScript project is growing too large and performance slows, it is often because of library folders like node_modules. If VS Code detects that your project is growing too large, it will prompt you to edit the exclude list.

So once we add this file, it by default will include everything in the directory of jsconfig.json and all subdirectories, including node_modules. By using include it explicitly says "only check these files, thanks!", which is equivalent to how we have our configuration for tsconfig.json.

Thoughts?

This comment has been minimized.

Copy link
@iansu

iansu Apr 19, 2019

Collaborator

That seems like a pretty good reason to me.

Show resolved Hide resolved docusaurus/docs/importing-a-component.md Outdated
@iansu

This comment has been minimized.

Copy link
Collaborator

commented Apr 19, 2019

Thank you for doing this. ❤️

iansu and others added some commits Apr 19, 2019

Update docusaurus/docs/importing-a-component.md
Co-Authored-By: ianschmitz <ianschmitz@gmail.com>
Update docusaurus/docs/importing-a-component.md
Co-Authored-By: ianschmitz <ianschmitz@gmail.com>
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]

This comment has been minimized.

Copy link
@mrmckeb

mrmckeb Apr 19, 2019

Collaborator

Do you need to specify src here? I haven't tested, just wondering... if not, we could simplify this.

This comment has been minimized.

Copy link
@rovansteen

rovansteen Apr 19, 2019

Collaborator

Not for absolute imports. It’s used to specify which files should be included for TypeScript compilation and/or which files should be analyzed by the IDE.

@iansu

iansu approved these changes Apr 19, 2019

@ianschmitz ianschmitz merged commit 2303b49 into facebook:master Apr 19, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
netlify/create-react-app/deploy-preview Docs deploy preview succeeded
Details

v3 automation moved this from In progress to Done Apr 19, 2019

@ianschmitz ianschmitz deleted the ianschmitz:jsconfig-docs branch Apr 19, 2019

@lock lock bot locked and limited conversation to collaborators Apr 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
5 participants
You can’t perform that action at this time.