Releases: snelsi/next-hubspot
2.0.0
[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
anduseHubspotForm
to useuseSyncExternalStore
internally (instead ofuseState
) for more stable state propagation across renders. - Introduced a new helper hook:
useHubspot
. - Expanded context values with more detailed script state:
isScriptLoaded
(replacesloaded
)isScriptError
(replaceserror
)scriptError
(new)hubspot
andhbspt
are now available directly from the context
- Renamed
formCreated
→isFormCreated
- Added
error
as a separate object for form creation failures
🛠 Breaking changes
- Replaced
loaded
,error
, andformCreated
with:isScriptLoaded
isScriptError
scriptError
isFormCreated
error
🔧 Migration guide
If you're using useHubspotForm
or accessing Hubspot context directly, you'll need to:
-
Replace:
const { loaded, error } = useHubspotContext();
with:
const { isScriptLoaded, isScriptError, scriptError } = useHubspotContext();
-
In
useHubspotForm
consumers, update:const { formCreated } = useHubspotForm(...);
to:
const { isFormCreated } = useHubspotForm(...);
-
Optionally use the new
useHubspot()
helper to accesshubspot
orhbspt
directly if needed.
Most projects will only need to rename 2–3 variables
Full Changelog: 1.2.0...2.0.0
1.2.0
⚠️ 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
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
What's Changed
- Add 'use client' to build exports
- Update dev dependencies
Full Changelog: 1.1.4...1.1.5
1.1.4
1.1.3
What's Changed:
- Update dev dependencies
- Update Rollup version
- Add
inlineSources: true
to thetsconfig
- Update License year
Full Changelog: 1.1.2...1.1.3
1.1.2
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
1.1.0
⚠️ 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