Skip to content

Conversation

@SteffenDE
Copy link
Collaborator

@SteffenDE SteffenDE commented May 8, 2025

This got a bit bigger than expected, but it addresses multiple things:

  1. includes type definitions for all public methods and interfaces. No need for @types/phoenix_live_view. The exported types are compatible with the currently documented type hints. Editors like VSCode now show detailed Intellisense.
  2. rewrites some files in Typescript
  3. updates eslint configuration to handle typescript
  4. includes Refactor pushEvent promise handling and document promise support #3763
  5. changes all commonjs files to modules
  6. allows defining Hooks as classes

Sadly, eslint ended up rewriting many lets to consts while I was changing the config, but I didn't notice so it's hard to undo now, but the change is fine; it just makes things harder to review :(

image image image image

Closes #3361.

@SteffenDE SteffenDE force-pushed the sd-typescript branch 3 times, most recently from 19c8b4c to d6121cb Compare May 8, 2025 18:38
"types": "./assets/js/types/index.d.ts",
"dependencies": {
"morphdom": "2.7.5"
"morphdom": "git+https://github.com/SteffenDE/morphdom.git#sd-fix-ts"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SteffenDE added 4 commits May 12, 2025 10:41
This got a bit bigger than expected, but it addresses multiple things:

1. includes type definitions for all public methods and interfaces. No
   need for `@types/phoenix_live_view`. The exported types are compatible
   with the currently documented type hints. Editors like VSCode now show
   detailed Intellisense.
2. rewrites some files in Typescript
3. updates eslint configuration to handle typescript
4. includes #3763
5. changes all commonjs files to modules
@SteffenDE SteffenDE added this to the v1.1 milestone May 12, 2025
@SteffenDE SteffenDE marked this pull request as ready for review May 13, 2025 13:00
@SteffenDE SteffenDE merged commit 03a6114 into main May 19, 2025
16 checks passed
@SteffenDE SteffenDE deleted the sd-typescript branch May 19, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS options when connecting the socket should be documented, and general JS documentation improvements

2 participants