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

Use explicit file types for module examples #3052

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

shanefontaine
Copy link
Contributor

@shanefontaine shanefontaine commented Apr 4, 2024

In "The module compiler option" section of the TS docs, it is difficult to understand that each pair of codeblocks represents a source file and built file. It is obvious in the markdown code due to the fact that the language is specified in the code block, but that is not transparent to the reader of the site. For example, the ES... example section has an identical input and output which is confusing for most even given the context of the section it is in or even the page they are on.

This PR attempts to fix that by adding filename comments above each pair of code blocks that specify that it is an input file (.ts) or a built file (.js). The syntax chosen matches the syntax from the "Type-only imports and exports" section on the same page.

As an example, here is the existing ES... section.

import x, { y, z } from "mod";
import * as mod from "mod";
const dynamic = import("mod");
console.log(x, y, z, mod, dynamic);

export const e1 = 0;
export default "default export";
import x, { y, z } from "mod";
import * as mod from "mod";
const dynamic = import("mod");
console.log(x, y, z, mod, dynamic);

export const e1 = 0;
export default "default export";

@shanefontaine
Copy link
Contributor Author

@microsoft-github-policy-service agree

@jakebailey jakebailey closed this Jun 5, 2024
@jakebailey jakebailey reopened this Jun 5, 2024
@jakebailey jakebailey added the deploy-preview Enables automatic deployments to preview environments on a PR label Jun 5, 2024
Copy link
Contributor

github-actions bot commented Jun 5, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3052.centralus.5.azurestaticapps.net

@jakebailey jakebailey merged commit 12879d1 into microsoft:v2 Jun 5, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-preview Enables automatic deployments to preview environments on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants