feature/feat-migrate-to-typescript #1544
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
4 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#1544
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen/frontend:feature/feat-migrate-to-typescript"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request:
lang="ts"
to all<script>
blocks in.vue
files.<script setup>
components withdefineComponent()
.<script setup>
that I did that instead.<script>
part, so I removed it (yes, it's optional).Motivation:
By using ts files we immediately get better typing, without changing anything else.
WIP: feature/feat-migrate-to-typescriptto feature/feat-migrate-to-typescriptHi dpschen!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://1544-feature-feat-migrate-to-typescri--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
008e990e75
to6bec9e3299
6bec9e3299
to5cfcc66346
Should we maybe also consider using type-based declaration for eg. props and emits?
https://vuejs.org/guide/typescript/composition-api.html#typing-component-props
I usually like them alot more :)
Absolutely! =)
This pull-request also shouldn't be understood as a full typescript conversion (the title is a bit misleading). Rather I tried to do as little as possible so that the request can be reviewed and merged fast.
We had too many large pull requests that stayed open for a long time and were hard to merge, so I try to split it into many smaller packages that are managable instead. If you look at other pull-requests you'll see that I usually implement typing for props and emits in converted and new components.
Sometimes there is a component where I know that there is another pull request that's beeing worked on. In this case I try to keep the diff as minimal as possible to prevent complex merge conflicts. In the medium to long term the goal is to convert everything to typescript and use the recommended linting settings (I think they also enforce some of the typing).
EDIT: I want to add that I merged multiple pull request in this one together so in the end this results in a mixture between converting some components to ts and just adding
lang="ts"
/defineComponent
/ renaming to ts files.I'm trying to incooporate the tsconfig files from https://github.com/vuejs/create-vue (or the compiled version under https://github.com/vuejs/create-vue-templates )
@ -18,9 +18,11 @@
</template>
<script lang="ts">
Do we need this script tag here at all?
Just because the name of the button is
x-button
(which we might want to change). But since this is not what this pull request is about I'd like not to change this here.@ -0,0 +1,32 @@
import AbstractModel from './abstractModel'
import UserModel from './user'
export default class LinkShareModel extends AbstractModel {
nice catch!
I found it because there were weird bugs happening after I imported the wrond model :D
@ -0,0 +3,4 @@
import {register} from 'register-service-worker'
if (import.meta.env.PROD) {
register('/sw.ts', {
Did you test this? AFAIK this won't get compiled so the browser will try to load
/sw.ts
directly (and fail).Will check.
Looks like the
sw.js
file itself is transpiled but the path here not adjusted automatically. I've adjusted the path infb2eb4c439
, seems to work great.I have found some other issues with the pwa setup.
Will push some WIP changes regarding that soon.
@ -0,0 +39,4 @@
})
// Set the interceptors to process every request
const self = this
I'm wondering if the
self
is even required since we're only using arrow functions here?Seems not necessary else this line wouldn't work aswell:
a2261a6900/src/services/abstractService.ts (L46)
Done in
5fad6bc57f
Looking good apart from the conflicts!
5fad6bc57f
to175b786ec6
Thanks for the effort!