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

Update to TypeScript 5.2 #276

Merged
merged 7 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Install Dev
if: steps.cache-dev.outputs.cache-hit != 'true'
run: npm ci
working-directory: 'dev'
working-directory: "dev"

- name: Test
run: npm run test:all
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx eslint --fix
npx prettier --write .
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
test/snapshots/
18 changes: 10 additions & 8 deletions ANALYZE.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,28 +189,30 @@ In addition, the entire content of HTMLElement is copied into the interfaces, so

### Component discovery

An LWC component class is automatically identified from a JavaScript/Typescript file if:
An LWC component class is automatically identified from a JavaScript/Typescript file if:

- It is the default export of the file
- The JS file name equals the parent folder name (ex: `/../mycomp/mycomp.{js|ts}`)
- There is an HTML template with the same name in the same folder (ex: `/../mycomp/mycomp.html`)
- There is an HTML template with the same name in the same folder (ex: `/../mycomp/mycomp.html`)

The component is named after the last 2 parts of its parent directory. For example, if the file path is
`/../myns/mycomp/mycomp.js`, then the component tag is `myns-mycomp`. The name is also transformed from camel case
to dash case: `/../myns/mycomp/myComp.js` leads to `myns-my-comp`.
to dash case: `/../myns/mycomp/myComp.js` leads to `myns-my-comp`.

For components that are not following the previous naming scheme, it uses 2 other methods:

For components that are not following the previous naming scheme, it uses 2 other methods:
- Checks if the class extends `LightningElement`.
This only works with a direct inheritance as it doesn't check the whole hierarchy.
This only works with a direct inheritance as it doesn't check the whole hierarchy.

- Looks for a `@lwcelement` JSDoc tag.
The JSDoc tag can also override the default tag name.
The JSDoc tag can also override the default tag name.

```javascript
/**
* @lwcelement my-element
*/
export default class MyElement extends BaseComponent {
```
```

#### In your own code

Expand Down Expand Up @@ -249,4 +251,4 @@ export default class MyElement extends LightningElement {
*/
@api prop3;
}
```
```
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/)
<!-- ### Removed -->
<!-- ### Fixed -->

## [2.0.0] - 2023-06-12

- Drop support for TypeScript pre-4.4. Testing with versions:
4.8, 4.9, 5.0, 5.1, 5.2

## [2.0.0-next.5] - 2023-06-12

- Drop support for 3.x versions of TypeScript. Testing with versions:
Expand Down
524 changes: 262 additions & 262 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/src/lit-element/lit-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class MyElement extends LitElement {
};
}

update(changedProperties: Map<PropertyKey, unknown>): void {
update(changedProperties) {
super.update();
}

Expand Down
Loading
Loading