Developer Announcements

jmclaren
HubSpot Employee
HubSpot Employee

Forms rendered by embed code are updating

As announced on the Developer Changelog:

Forms rendered by the HubSpot form embed codes are updating.Two changes will be occurring. Most accounts and forms should not expect to have any issues.

 

What's changing?

We're updating our form embed to use a more recent version of React. The data-reach-id attribute that appears on DOM elements will be going away. Most developers do not target this ID with JavaScript or CSS and should not see an issue, but out of an abundance of empathy and transparency we are letting everyone know ahead of time.

 

Additionally our forms embed script will no longer attach internal dependencies to the window.hubspot, window.hbspt, window.HSFR properties. While these dependencies were required for the internal functionality of HubSpot forms, their attachment to a window property made them available for other scripts on the page. In the unlikely event your code relied on these dependencies, you will need to update any form related custom code to rely on their own dependencies.

 

All documented methods of integrating with our embed will continue working. To integrate with our forms embed, you can continue to use the documented APIs at https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options
https://legacydocs.hubspot.com/global-form-events 

 

These changes do not require someone to update the embed code snippet already used on their pages.

 

When is this happening?

These changes will be going into effect on October 18th, 2022. If you are relying on the data-react-id or internal dependencies you will want to make your changes before then.

 

Questions or comments? post below.

Edit 7/25/2022 - added clarification around the window.hbspt property.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

0 Votes
10 Réponses
Denis
Contributeur | Partenaire solutions
Contributeur | Partenaire solutions

Forms rendered by embed code are updating

@jmclarenis there a way to test our forms with the new script before the official release? We have pretty extensible customizations.

0 Votes
jmclaren
HubSpot Employee
HubSpot Employee

Forms rendered by embed code are updating

There isn't a way to test right now. The jist though is, if you followed what's in the documentation, you're fine. You're basically just affected if you specifically wrote custom code that relied on data-react-id, or wrote custom code relying on undocumented window object data. The vast majority of developers would not rely on the window object data, as it was undocumented, and you needed to know that data was there. 

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

0 Votes
CPMTTL88
Membre

Forms rendered by embed code are updating

Hey jmlcaren,
Just a quick question for you about this.
Does this change also apply to the window.hbspt property? I'm relying on that dependency for some functionality.
Thanks!

jmclaren
HubSpot Employee
HubSpot Employee

Forms rendered by embed code are updating

@CPMTTL88, great question, we are deprecating that as well, except for the create function.

I've updated the post and announcement in the changelog to make this more clear.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

0 Votes
SKumar15
Participant | Partenaire solutions Elite
Participant | Partenaire solutions Elite

Forms rendered by embed code are updating

Hi @jmclaren , The "HSFR" property is being deprecated too? 

0 Votes
jmclaren
HubSpot Employee
HubSpot Employee

Forms rendered by embed code are updating

I replied over Slack, but for anyone else who comes to this thread I want them to find the answer too.

We are indeed deprecating window.HSFR as well. HSFR was not documented, and not intended for developers to modify/rely on.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

0 Votes
CDean
Contributeur

Forms rendered by embed code are updating

Can you confirm that this 

hbspt.forms.create

function is completely untouched in the update?

 

https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options

 

0 Votes
jmclaren
HubSpot Employee
HubSpot Employee

Forms rendered by embed code are updating

Correct, create is not affected.

 


@CDean wrote:

Can you confirm that this 

hbspt.forms.create

function is completely untouched in the update?

 

https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options

 




Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

0 Votes
SKumar15
Participant | Partenaire solutions Elite
Participant | Partenaire solutions Elite

Forms rendered by embed code are updating

Same question, @hubspot Team? 

0 Votes
jmclaren
HubSpot Employee
HubSpot Employee

Forms rendered by embed code are updating

Same answer as this question.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

0 Votes