-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
content/notes/how-typescript-is-integrated-in-your-editor/en/index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<SmoothRender> | ||
|
||
_My notes on the "How TypeScript is integrated in your editor" tech talk by Maria Solano_ | ||
|
||
--- | ||
|
||
<iframe | ||
width="100%" | ||
height="315" | ||
src="https://www.youtube.com/embed/ne_UYfDmDYc" | ||
title="YouTube video player" | ||
frameborder="0" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
allowfullscreen | ||
></iframe> | ||
|
||
When running this code: | ||
|
||
```js | ||
function printGreeting() { | ||
const greeting = 'Hola amigos!'; | ||
console.log(greeting); | ||
} | ||
``` | ||
|
||
- There's a lightbulb after the `greeting` variable declaration | ||
- How the items get displayed when clicking on it? | ||
- How this experience is uniform across editor? | ||
|
||
## Trigger Event | ||
|
||
- The cursor is in a spot where a code fix (or refactoring) can be applied. | ||
- Manually invoked (via a key binding) | ||
|
||
Handling the trigger event | ||
|
||
- The editor records the position (line and column) | ||
- The editor records the content type | ||
|
||
In visual studio code you can use the LSP (Language Server Protocol). But it can also be done by hooking up an extension to the code action like ESLint. | ||
|
||
## TSServer: The language server | ||
|
||
A node executable that encapsulates the TypeScript compiler and language services and exposes them through a JSON protocol. | ||
|
||
Isn't this just `tsc`? No, TSServer isn't resposible for compilation. | ||
|
||
--- | ||
|
||
</SmoothRender> |
19 changes: 19 additions & 0 deletions
19
content/notes/how-typescript-is-integrated-in-your-editor/en/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"title": "How TypeScript is integrated in your editor", | ||
"description": "Notes: How TypeScript is integrated in your editor", | ||
"date": "2023-10-07", | ||
"tags": [ | ||
{ | ||
"href": "/tags/web-performance", | ||
"name": "webperf" | ||
} | ||
], | ||
"coverImage": { | ||
"src": "/notes/starting-a-dedicated-web-performance-team.png", | ||
"width": "640", | ||
"height": "334", | ||
"alt": "The cover of sarah's talk", | ||
"authorHref": "", | ||
"authorName": "" | ||
} | ||
} |