Skip to content

Typescript migration #146

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

Closed

Conversation

mst101
Copy link
Contributor

@mst101 mst101 commented May 18, 2022

@MrWook - I've rebased this branch off the latest master branch into which I also merged in my latest PR #145 (although I look forward to your review of that...) and have set about converting everything to TypeScript.

It's been a good exercise in applying my nascent TypeScript skills, although I have resorted to adding // @ts-ignore in a few places where I didn't know what to do.

Now, when I run npm run build, I am no longer getting the above error, but this instead:

[!] (plugin babel) SyntaxError: /home/mark/repos/vue-datepicker/src/components/Datepicker.vue?rollup-plugin-vue=script.ts: Support for the experimental syntax 'decorators-legacy' isn't currently enabled (157:1):

  155 | import Popup from './Popup.vue'
  156 |
> 157 | @Component({
      | ^
  158 |   components: {
  159 |     DateInput,
  160 |     PickerDay,
src/components/Datepicker.vue?rollup-plugin-vue=script.ts (157:0)
SyntaxError: /home/mark/repos/vue-datepicker/src/components/Datepicker.vue?rollup-plugin-vue=script.ts: Support for the experimental syntax 'decorators-legacy' isn't currently enabled (157:1):

One stackoverflow post suggested I should install the @babel/plugin-proposal-decorators package and add ["@babel/plugin-proposal-decorators", { "legacy": true }] to the plugins section of the .babelrc file.

I have tried this, however, the error persists. So basically, I'm stuck - and would appreciate some help! :-)

mst101 and others added 30 commits August 10, 2021 17:51
Setup e2e testing with BDD, Cypress & Cucumber
mst101 and others added 25 commits April 25, 2022 19:26
@mst101
Copy link
Contributor Author

mst101 commented May 18, 2022

Sorry, I was expecting this to follow on from #127... but I must have done something wrong :-|

Anyway, hopefully you (or someone else?) can see the code and help me understand why I'm getting those errors?

@MrWook
Copy link
Collaborator

MrWook commented Jun 6, 2022

Hey i will check it out 👍

Edit:
This is a real pain in the ass 🤔 I got somewhere with changing to another rollup plugin and pushed it into my branch.
I'm not so sure about the class based components anymore :( I really love it but it will increase the bundle size for some personal flavor 🤔
Maybe we should directly move to vue3

@mst101
Copy link
Contributor Author

mst101 commented Jun 22, 2022

Thanks for having checked this out. Glad it wasn't only me banging my head against the wall!

I'll close this and do what you suggest... but can we please move to Vite first ;-). I see what you've started for the build in vue3-support and have managed to get a dev environment set up in vite. Still need to have a look at vitetest as a replacement for jest...

@mst101 mst101 closed this Jun 22, 2022
@mst101 mst101 deleted the feat/typescript-migration branch December 6, 2023 13:15
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.

3 participants