Skip to content

Releases: snelsi/next-hubspot

2.0.0

14 Feb 15:37
767051c
Compare
Choose a tag to compare

[v2.0.0] - Major rewrite of Hubspot integration

This release introduces a major internal refactor of context and form hook logic, focused on improving reliability and consistency during client-side navigation and rerenders.

✨ What's new

  • Rewrote HubspotProvider and useHubspotForm to use useSyncExternalStore internally (instead of useState) for more stable state propagation across renders.
  • Introduced a new helper hook: useHubspot.
  • Expanded context values with more detailed script state:
    • isScriptLoaded (replaces loaded)
    • isScriptError (replaces error)
    • scriptError (new)
    • hubspot and hbspt are now available directly from the context
  • Renamed formCreatedisFormCreated
  • Added error as a separate object for form creation failures

🛠 Breaking changes

  • Replaced loaded, error, and formCreated with:
    • isScriptLoaded
    • isScriptError
    • scriptError
    • isFormCreated
    • error

🔧 Migration guide

If you're using useHubspotForm or accessing Hubspot context directly, you'll need to:

  1. Replace:

    const { loaded, error } = useHubspotContext();

    with:

    const { isScriptLoaded, isScriptError, scriptError } = useHubspotContext();
  2. In useHubspotForm consumers, update:

    const { formCreated } = useHubspotForm(...);

    to:

    const { isFormCreated } = useHubspotForm(...);
  3. Optionally use the new useHubspot() helper to access hubspot or hbspt directly if needed.

Most projects will only need to rename 2–3 variables

Full Changelog: 1.2.0...2.0.0

1.2.0

31 Oct 13:52
Compare
Choose a tag to compare

⚠️ Breaking changes

  • This package is now pure ESM
  • Min supported version of Next.js was bumped to >=13
  • Min supported version of React and React-Dom was bumped to >=18
  • Bump required node to >=18

What's changed

  • Update peerDependencies to support Next.js v14
  • Update devDependencies
    • Update rollup version to v4
    • Update next.js version to v14
    • Update prettier version to v3

Full Changelog: 1.1.6...1.2.0

1.1.6

20 Mar 09:34
Compare
Choose a tag to compare

What's changed

  • Update dev dependencies
  • Update Rollup version
  • Update Typescript version
  • Run eslint + prettier on all files

Full Changelog: 1.1.5...1.1.6

1.1.5

15 Feb 19:08
Compare
Choose a tag to compare

What's Changed

  • Add 'use client' to build exports
  • Update dev dependencies

Full Changelog: 1.1.4...1.1.5

1.1.4

07 Feb 08:46
Compare
Choose a tag to compare

What's Changed

  • Update dev dependencies
  • Update Rollup version

Full Changelog: 1.1.3...1.1.4

1.1.3

23 Jan 13:26
Compare
Choose a tag to compare

What's Changed:

  • Update dev dependencies
  • Update Rollup version
  • Add inlineSources: true to the tsconfig
  • Update License year

Full Changelog: 1.1.2...1.1.3

1.1.2

09 Jan 14:39
Compare
Choose a tag to compare

What's Changed

  • Update dev dependencies
  • Update Rollup setup
  • Drop terser Rollup plugin
  • Internal build types output moved to a separate folder types
  • Minor hubspot types update

Full Changelog: 1.1.1...1.1.2

1.1.1

25 Nov 19:08
Compare
Choose a tag to compare

Changes:

  • Revert type update for onFormSubmit

Seems like Hubspot reverted some of their changes for the forms script?
In my tests onFormSubmit method started to return HTMLFormElement, the same as before.
Not sure what happened, better to keep an eye on it.

1.1.0

25 Nov 10:13
Compare
Choose a tag to compare

⚠️ This release contains some Breaking Changes:

  • Minimum supported Node version is bumped to 16+
  • Update the HubspotFormProps types definition

Changes:

  • Update to Rollup v3
  • Update Rollup setup + plugins
  • Update dev dependencies

HubspotFormProps types update

I'm not sure when, but at some point, Hubspot changed its form of integration API. After some testing, I found out that docs are outdated. Some form methods are missing, and some prop types are wrong.

To fix this I manually reverse-engineered the source code and updated the HubspotFormProps to better represent existing methods.

It's still full of unknown and any props for now, but hopefully, it should be more accurate than before

1.0.6

24 Sep 09:40
Compare
Choose a tag to compare
  • Swap 'any' with 'unknown' in Hubspot types definition
  • Fix Typo in documentation
  • Update dev dependencies
  • Add .prettierignore file config