jQuery UI Widgets Forums Angular jQWidgets 4.5.1 TypeScript errors

This topic contains 20 replies, has 9 voices, and was last updated by  Martin 6 years, 8 months ago.

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
  • jQWidgets 4.5.1 TypeScript errors #92627

    Daniel
    Participant

    Hi,

    I am using jQWidgets 4.5.1. After upgrading from jQWidgets 4.5.0 webpack reports the following errors:

    jqwidgets-ts/jqwidgets.d.ts (1979,9): Duplicate identifier 'localization'
    jqwidgets-ts/jqwidgets.d.ts (2004,9): Duplicate identifier 'localization'
    jqwidgets-ts/jqwidgets.d.ts (2004,9): Subsequent variable declarations must have the same type. Variable 'localization' must be of type 'any', but here has type 'Object'.
    
    jqwidgets-ts/angular_jqxcalendar.ts (531,11): Cannot find name 'value'. Did you mean the instance member 'this.value'?
    jqwidgets-ts/angular_jqxcomplexinput.ts (288,11): Cannot find name 'value'. Did you mean the instance member 'this.value'?
    
    jqwidgets-ts/angular_jqxgrid.ts (100,27): Duplicate identifier 'attrLocalization'.
    jqwidgets-ts/angular_jqxgrid.ts (696,4): Duplicate function implementation.
    jqwidgets-ts/angular_jqxgrid.ts (896,4): Duplicate function implementation.

    Best regards,
    Daniel

    jQWidgets 4.5.1 TypeScript errors #92641

    rjwijnen
    Participant

    Did you check your tsconfig.json with the one on the site? I thought i had this error also today.

    jQWidgets 4.5.1 TypeScript errors #92647

    Ivo Zhulev
    Participant

    Hi Daniel,

    There is indeed a duplication with the ‘localization’ property.
    For the ‘value’ errors we can`t seem to find an error.
    Thanks for the report!

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

    jQWidgets 4.5.1 TypeScript errors #92652

    Daniel
    Participant

    Hi Ivo,

    as far I can see the val() function’s signature in angular_jqxcalendar.ts (line 530) changed from (jQWidgets 4.5.0)

    val(arg?: String | Number): any {
          if (arg !== undefined) {
    ...

    to (jQWidgets 4.5.1)

    val(date, date2): any {
          if (value !== undefined) {
    ...

    In 4.5.0 the argument ‘arg’ was checked whether it is undefined or not. But in 4.5.1 there is no argument named ‘value’. So typescript cannot resolve this variable.

    Best regards,
    Daniel

    jQWidgets 4.5.1 TypeScript errors #92680

    Ivo Zhulev
    Participant

    Hi Daniel,

    Thanks for that report too.

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

    jQWidgets 4.5.1 TypeScript errors #93012

    @Ivo Zhulev, is there a patch to fix the Typescript error?
    What is the ETA for the patch?
    Or if there is a workaround, can you share it?

    Do you suggest we roll back to the previous version?

    Thanks
    Yong

    jQWidgets 4.5.1 TypeScript errors #93017

    Ivo Zhulev
    Participant

    Hi yongchen45,

    The workaround – just match the arguments in the angular_jqxxxxxx files.

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

    jQWidgets 4.5.1 TypeScript errors #93033

    Ivo,

    I am not quite understanding your suggestion.
    Can you put some code snippets as example?
    I.e. jqxButton jqxGrid

    Thanks

    jQWidgets 4.5.1 TypeScript errors #93068

    Ivo,

    I have not heard from you.
    Are you suggesting WE change the source code we downloaded?
    If so, what’s the plan that in next release that we don’t have to do this all over again?

    Thanks

    jQWidgets 4.5.1 TypeScript errors #93083

    Ivo Zhulev
    Participant

    Hi yongchen45,

    Just go to let’s say angular_jqxbutton.ts file, find the prop you get errors from – lets say val, and match the types and names of the arguments:

    val(date, date2): any {
          if (value !== undefined) {

    to:

    val(date: any, date2: any): any {
          if (date!== undefined) {

    These files are not minimized because in some cases you will need to change something there in order to get some custom things for your project.
    As for the next release, you won’t have to change anything in your code.

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

    jQWidgets 4.5.1 TypeScript errors #93305

    kryptonianson
    Participant

    While I can use this workaround for myself, it is getting a bit frustrating on our build systems. Will this be fixed soon so we do not have to do this?

    Also, there is a conflict in the jqwidgets.d.ts definitions on line 9. It reads:

    declare var $: any;

    It should be:

    declare var $: JQueryStatic;

    Thanks for all your help. Look forward to hearing from you.

    jQWidgets 4.5.1 TypeScript errors #93311

    Ivo Zhulev
    Participant

    Hi kryptonianson,

    This errors won’t be in the next release which will be this month.
    As for the declare var $: any; -> thanks for that propose. I’ll look into it.

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

    jQWidgets 4.5.1 TypeScript errors #93352

    kryptonianson
    Participant

    I would like to clarify what I mean by the jQuery conflict. This is specifically with the @types/jquery definitions. I hope this helps. Thank you again.

    jQWidgets 4.5.1 TypeScript errors #94011

    Dmytro Gokun
    Participant

    I’d like to say that we have the same issue.
    Our app references (implicitly, because of another dependency we have) “@types/jquery”. This makes compilation fail with the following message:

    jqwidgets-ts/jqwidgets.d.ts (9,13): Subsequent variable declarations must have the same type. Variable ‘$’ must be of type ‘JQueryStatic’, but here has type ‘any’.

    I think, jqwidgets should also reference “@types/jquery” to be a good citizen in the TypeScript world :). The change looks trivial on its surface … Is there any chance for that happening in the near future?

    jQWidgets 4.5.1 TypeScript errors #94013

    Ivo Zhulev
    Participant

    Hi Dmytro Gokun,

    Are you sure you are running on jQWidgets version 4.5.3?

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic.