This is a migrated thread and some comments may be shown as answers.

Deprecation of document.registerElement

7 Answers 349 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Marcin asked on 14 Jan 2019, 02:42 PM

Hello,

recenlty on Chrome dev console warning started to appear about deprecation of document.registerElement method

[Deprecation] document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.

When I checked what would happen if this function is no longer available, our application crashed. We have custom bundle so according to this: https://github.com/telerik/kendo-ui-core/issues/4675 the solution would be to upgrade R1.2019 when it will be available.

So my question is when this version is planned to be available, or do you know if upgrading to current latest version would solve this problem?

7 Answers, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 14 Jan 2019, 04:41 PM
Hello, Marcin,

Thank you for sharing that you have already seen the logged issue related to this Chrome warning.

The R1 2019 release is coming up in a couple of days - it is due on 16th January. (I have now added this milestone to the issue - apologies for the late update on our part in the issue).

The fix itself removed all references to kendo webcomponents.js so that the warning will disappear. However, you mentioned:

When I checked what would happen if this function is no longer available, our application crashed.

Can you please let me know if you removed just the function or the reference to the kendo.webcomponents.js from the application?
Can you let us know at which point is this script used and the function called?

Look forward to hearing back from you.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Marcin
Top achievements
Rank 1
answered on 15 Jan 2019, 09:04 AM

Hello, I have just removed this function from document, as this is the worst case scenario which we need to be prepared.

As for the errors, when the page is loaded I get first error from kendo.custom.min.js which is:

kendo.custom.min.js:7 Uncaught TypeError: document.registerElement is not a function

 

And then when creating component, there is error that component is not a function, in this case it's kendoListView. As I observed after the first error there is no any kendo components available.

0
Alex Hajigeorgieva
Telerik team
answered on 15 Jan 2019, 12:17 PM
Hi, Marcin,

Thank you for clarifying how the application stopped working.

The kendo.custom.min.js script was probably created by the Custom Download Builder Tool which bundled the kendo.webcomponents.js. As of tomorrow, the Download Builder Tool should not include the kendo.webcomponents.js and the warning will go away.

Nonetheless, the only place in the source where document.registerElement() is used is in kendo.webcomponents.js. This function is not used in the jQuery, ASP.NET MVC, ASP.NET Core, JSP, PHP, React, Vue or AngularJS wrappers so none of these applications would be affected.

The only people who would be affected are the ones who created web components and still use them. In case there are no web components in the application you are working on, you do not need to do anything special. Just download the latest version of Kendo UI and the warning should be gone.
 
Let me know if you have further questions.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Syed Irtaza
Top achievements
Rank 1
answered on 18 Mar 2019, 03:00 PM

Hi

We are using 2016 version of Kendo UI on some old websites.

What do we have to do to fix this issue without upgrading to a newer version.

 

Regards

Irtaza

0
Alex Hajigeorgieva
Telerik team
answered on 19 Mar 2019, 04:38 PM
Hello, Syad,

You can also take advantage of the Custom Download builder tool for the older versions.

- Select the version that you are currently using and do not wish to update from the dropdown list.



- Select the needed functionality

- Make sure the web components script is deselected


Download the script and replace where in use.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Syed Irtaza
Top achievements
Rank 1
answered on 22 Mar 2019, 12:02 PM

Hi Alex,

I am getting the warning on kendo.all.js and the custom download generates kendo.custom.min.js

 

kendo.all.js:119632 [Deprecation] document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
l @ kendo.all.js:119632

 

How do I get this file from custom download

 

Regards

Irtaza


0
Alex Hajigeorgieva
Telerik team
answered on 26 Mar 2019, 09:33 AM
Hello, Irtaza,

The kendo.all.min.js package which was distributed back in 2016 contains the kendo.webcomponents.min.js file which causes the warning.

To avoid the error, you should use the Custom Download Builder tool and download the version that you need. If you let me know which version exactly you are using, I can test it for you. You can easily rename the file from kendo.custom.min.js to kendo.all.min.js and continue using the old version by replacing the kendo.all.min.js file which was distributed at the time with the one you created with the download builder tool.

*** For very old versions,i.e. 2014 there may be other dependencies but for 2016 this approach should work

Let me know in case you have further questions or concerns.
 
Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Marcin
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Marcin
Top achievements
Rank 1
Syed Irtaza
Top achievements
Rank 1
Share this question
or