- 042980b: Add the ability to add aliases/slug to sites in the multisite setup
- 8ba6de7: Fix: do not cast menu item ids to number as they are strings
- d9dcec0: Fix TS type for link component in SettingsContextProps
- fc7e426: Added - Support for custom menu item CSS classes.
Added -
menu-item-has-children
CSS class for menu item with children.
- 9ea83c3: Fix: return config from queryPostOrPosts
- fe250b7: Fix: only run parseBlockAttribute when forwardBlockAttribute is set for nodes that represent wp blocks
- d49ac5c: Allow overriding fetch strategy
- 915c6b6: RSC compatible image block for next.js
- 6fa9ec2: Introducing previewRouteHandler to handle preview in Next.js App Router
- 96ea386: Initial App Router Support
- e969f38: Introducing SEO handling for App Router
- 2c51bfb: Link handling
- 79ae20e: Adding support for
i18n
routing in app router - 6fa9ec2: Introducing
revalidateRouteHandler
for handling revalidate requests in Route Handlers (App Router) - 4f7a665: Add
forwardBlockProps
to BlocksRenderer which automatically forwards block props to children components - ca94535: Introduce
blockContext
prop to BlocksRenderer andhandleError
in query functions - d696703: Multisite support in App Router
- 14c398d: remove usage of defaultProps and intropduce the ability to attach a default test function directly to the component
- 4044248: Introducing
loadHeadstartWpConfig()
- 9f05f3f: Fix fetch cache option
- c73d000: Fix: SEO with yoast disabled
-
f6e005c: Fix: Improve types for better page props type inference.
It also updates types for data fetching hooks to better reflect the fact that
data
is treated as though it is always there and if users do not check forloading
orerror
by themselves and there's no preloaded data, a runtime fatal error will be issued instead.
- b3cd5fe1: Fix: more fixes for esm builds
- e7c84d58: Fix builds with vite
- 399af783: Make ESM builds ESM compatible
- b3cd5fe1: Fix: more fixes for esm builds
- 399af783: Make ESM builds ESM compatible
- e7c84d58: Fix builds with vite
- 66031ec6: Pass params attr to YoutubeLiteBlock
- 38563cfd: Fix cache.beforeSet
- cce64d2e: Introducing fetch strategy caching.
- 8d3a0f83: Normalize TTL to secs
- 669441f3: Fix: cache handler types, add isCached property
- 498fb394: caching: pass
fetchStrategyOptions
andpath
to cache functions. - bdcc37f0: Make cache.enabled optional
- 8d3a0f83: Normalize TTL to secs
- bdcc37f0: Make cache.enabled optional
- 669441f3: Fix: cache handler types, add isCached property
- 498fb394: caching: pass
fetchStrategyOptions
andpath
to cache functions.
- cce64d2e: Introducing fetch strategy caching.
- 5d5a856a: Expose swr "bound mutate" function
- 654681df: Fix: replace camelcase underlying implementation as the previous one only worked in node
- 95d6eb96: fix: make convertUrl and removeSourceUrl respect the original link's trailingslash
- 26246a01: Add the ability to leverage
post.link
for redirecting the previewed post to the appropriate route via thepreview.usePostLinkForRedirect
setting.
- 0bd8e415: Add ability to preview using an alternative authorization header
- 8452279a: Implement WordPress native search endpoint
- 6dc435f7: Add support for archive path matching
matchArchivePath
. Add support for passing a function tocustomPostTypes
andcustomTaxonomies
option inheadstartwp.config.js
. Renameheadless.config.js
toheadstartwp.config.js
but keep backward compatibility. Automatically loadheadstartwp.config.js
orheadless.config.js
innext.config.js
.
- 6dc435f7: Add support for archive path matching
matchArchivePath
. Add support for passing a function tocustomPostTypes
andcustomTaxonomies
option inheadstartwp.config.js
. Renameheadless.config.js
toheadstartwp.config.js
but keep backward compatibility. Automatically loadheadstartwp.config.js
orheadless.config.js
innext.config.js
.
- 15189a03: Adding support for basic auth
- 772c5f1c: Fix: fetchHookData with usePosts and throwIfNotFound set to false will crash the application if no results are found
- 772c5f1c: Fix: fetchHookData with usePosts and throwIfNotFound set to false will crash the application if no results are found
- 15189a03: Adding support for basic auth
- de501ff7: Fix an issue for images without width or height
- 4275962b: Introducing
usePostOrPosts
. - df3e65ce: Introduces
SafeHtml
andHtmlDecoder
components. - e9064d69: Introducing the
useSeo
hook. - d3ec9d83: Introduces the
decodeHtmlSpecialChars
function.
-
e6a0c231: Lower compilation target
-
24f8a99f: Fix theme.json handling in
useBlockColors
anduseBlockTypography
.Thanks @riccardodicurti @dhamibirendra for the bug report.
-
bb39a603: Fixes useSearch error when Yoast SEO plugin is deactivated.
-
569662b6: Improves the Next.js preview cookie handling and fixes a bug where the locale was not properly being passed from WP when previewing.
First of all, it sets the preview cookie to expire within 5 minutes which aligns with the JWT token expiration.
Secondly, it will narrow the cookie to the post path being previewed so that
context.preview
is not true for other paths and thus avoiding bypassing getStaticProps until the cookies are cleared (either expires or the browser closes). -
56ddf9be: Fix theme.json handling for block settings
-
1494a332: Further Optimize next.js props by removing yoast seo bloat.
- e9064d69: Introducing the
useSeo
hook.
- 4275962b: Introducing
usePostOrPosts
.
- 56ddf9be: Fix theme.json handling for block settings
- e6a0c231: Lower compilation target
- bb39a603: Fixes useSearch error when Yoast SEO plugin is deactivated.
- 1494a332: Further Optimize next.js props by removing yoast seo bloat.
- df3e65ce: Introduces
SafeHtml
andHtmlDecoder
components. - d3ec9d83: Introduces the
decodeHtmlSpecialChars
function.
-
24f8a99f: Fix theme.json handling in
useBlockColors
anduseBlockTypography
.Thanks @riccardodicurti @dhamibirendra for the bug report.
-
569662b6: Improves the Next.js preview cookie handling and fixes a bug where the locale was not properly being passed from WP when previewing.
First of all, it sets the preview cookie to expire within 5 minutes which aligns with the JWT token expiration.
Secondly, it will narrow the cookie to the post path being previewed so that
context.preview
is not true for other paths and thus avoiding bypassing getStaticProps until the cookies are cleared (either expires or the browser closes).
- 225724d8: Fix an issue where an empty result would still yield a "matching slug error" when thrownIfNotFound was set to false
- 62ac6b36: Fixing typos.
- c3de4f3d: Fix: avoid instanceof to prevent weird bugs
- 2cbaec01: Fix: add attributes that should not be stripped by wpKsesPost to the allowlist
- 1beed833: fix: youtube lite embeds
- c3de4f3d: Fix: avoid instanceof to prevent weird bugs
- 2cbaec01: Fix: add attributes that should not be stripped by wpKsesPost to the allowlist
- 1beed833: fix: youtube lite embeds
- ba952037: Fix: fetch calls made under getStaticProps now always includes a timestamp in the query to ensure it always get latest content from the api
- b26210d: Fix: anchor attributes being stripped by wpKsesPost
- f016b00: Re-exporting html-react-parser from core package
- 1f4491f: Renaming to HeadstartWP
- a5c5e52: Fix middlewares do that it doesnt load the whole core library
- af507b7: Updating swr to latest version
- 97ac0b0: Add devMode for more debugging data
- 7ec30e1: Abstract SWRConfig in core package
- 6ce773e: Reverting CJS only
- a5c5e52: Fix middlewares do that it doesnt load the whole core library
- 7ec30e1: Abstract SWRConfig in core package
- f20d010: Re-add workaround
- 6ce773e: Reverting CJS only
- 5bdd604: Switching to CJS only
- 97ac0b0: Add devMode for more debugging data
- af507b7: Updating swr to latest version
- 1f4491f: Renaming to HeadstartWP
- 44d5607: New strategy for loaidng config
- 3cd203c: Add support for logging/debugging.
- bd83dc9: Added SVG support, so they don't get automatically stripped by the sanitizer
- 3029765: Updated parseSeo utility function to remove async/await
-
1f7e4ff: Added parseSeo utility function
-
fdde401: Introduces a new feature: The PolyLang Integration. To use simply enable the integration
module.exports = { // other settings integrations: { yoastSEO: { enable: true, }, polylang: { enable: true, }, }, };
and add the supported locales to next.config.js.
module.exports = { i18n: { // These are all the locales you want to support in // your application locales: ["en", "fr", "nl"], // This is the default locale you want to be used when visiting // a non-locale prefixed path e.g. `/hello` defaultLocale: "en", }, };
- 60af8c8: Improve package compatibility with system that do not support package.json exports
- a444791: Fix TS types
- 1f7e4ff: Added parseSeo utility function
- 60af8c8: Improve package compatibility with system that do not support package.json exports
- a444791: Fix TS types
-
fdde401: Introduces a new feature: The PolyLang Integration. To use simply enable the integration
module.exports = { // other settings integrations: { yoastSEO: { enable: true, }, polylang: { enable: true, }, }, };
and add the supported locales to next.config.js.
module.exports = { i18n: { // These are all the locales you want to support in // your application locales: ["en", "fr", "nl"], // This is the default locale you want to be used when visiting // a non-locale prefixed path e.g. `/hello` defaultLocale: "en", }, };
- e827579: Instead of only checking for HEAD requests, check for a custom header for skipping redirect to the front-end url
- e827579: Instead of only checking for HEAD requests, check for a custom header for skipping redirect to the front-end url
- 664f306: Fix redirects by using resolvedUrl instead of req.url
- 664f306: Fix redirects by using resolvedUrl instead of req.url
- 9bf3642: Check for wp-admin and related paths in isInternalLink
- 9fa4319: Fix previews handling for multisite with locale
- 3671143: Fixes an issue where taxonomy archives would support non-standard WP routes (/category/author/author-name and /category/:year/:month/:day) and adds support for nested taxonomy routes (/parent-category/category).
- 61231c3: Fix: add css allowlist similar to WordPress wp_kses_post
- 6282580: Introducing
matchCurrentPath
flag andfullPath
option to usePost hook for better control over post path mapping
- 6282580: Introducing
matchCurrentPath
flag andfullPath
option to usePost hook for better control over post path mapping
- 0c0350a: Improve TypeScript Support
- 83f2fd6: Remove unnecessary dependency.
- 4093142: Introducing types for next.js data-fetching methods and the ability to pass default param via fetcher()
- 906f32a: Fix: defaultParams were not being taken into account
- d062e6e: Fix: addHookData ts typing
- 13a1327: Update TypeScript types for WP entities
- 83f2fd6: Remove unnecessary dependency.
- d062e6e: Fix: addHookData ts typing
- 906f32a: Fix: defaultParams were not being taken into account
- 4093142: Introducing types for next.js data-fetching methods and the ability to pass default param via fetcher()
- 0c0350a: Improve TypeScript Support
- 13a1327: Update TypeScript types for WP entities
- 2a35630: fix ts entry points in package.json
- d039566: #318 feat: add an official yoast seo integration.
-
1bff95c: #305]. Fix post path mapping for custom post types.
Since the introduction of #286 fetching single custom post types would always yield a 404. This PR fixes the issue by properly matching the current path with the custom post permalinks.
This requires that the
single
property is set inheadless.config.js
.customPostTypes: [ { slug: 'book', endpoint: '/wp-json/wp/v2/book', // these should match your file-system routing single: '/book', archive: '/books', }, ],
Without the
single
property set the headless framework can't properly match the current URL to the custom post's permalink.This PR builds on top of the philosophy that the WordPress permalink structure should match the front-end permalink structure, meaning that your front-end routes should match the permalink structure set in WordPress.
-
1bff95c: #304 fix: post path mapping for ut8encoded slugs.
Previously the code that would match the path of the current page with post's links would always fails for any URLs that contains encoded UTF-8 characters. This patch fixes the issue.
-
33592ea: Introducing Multisite support to the headless framework.
-
33592ea: Add ability to use the
yoast_head
html to populate the head tags instead of manually rendering every property of the yoast_head_json -
33592ea: Parses the style attribute of HTML elements into an object, and passes that object down as a prop through the BlocksRenderer component.
Also updates block components to pass style down as a prop to the provided components.
Closes #240
-
33592ea: Add React 18 and Next.js 13 support.
-
33592ea: warn if
removeSourceUrl
is used without validlink
orbackendUrl
values. -
33592ea: fix: removeSourceUrl should not add a / to the beginning of the link if it's a hash link. #267
-
33592ea: Export block-related hooks
-
33592ea: Fix: check if current path matches the returned post in the SinglePostFetch strategy
-
33592ea: Improve redirect handling in
fetchRedirect
.It now detects redirects that might cause infinite loop and ignore redirects for
wp-login.php
,wp-register.php
andwp-admin
. -
33592ea: add js-xss options param to wpKsesPost and exposing sanitizeFn function to BlocksRenderer
e.g
wpKsesPost( `<p data-post='${JSON.stringify(json_object)}'>Hello World</p>`, { p: ['data-post'], }, { onTag(tag, html, options) { if (options.isWhite && tag === 'p') { return html; } return undefined; }, }, ),
<BlocksRenderer html={html} sanitizeFn={(html) => mySanitizitationFn(html)}> {children} </BLocksRenderer>
-
33592ea: Fix child pages with same slugs but different parent. Takes the link property in account to properly match the right page.
- e0dfa77: warn if
removeSourceUrl
is used without validlink
orbackendUrl
values. - e1b79c7: Fix: check if current path matches the returned post in the SinglePostFetch strategy
- ae938bd: Add ability to use the
yoast_head
html to populate the head tags instead of manually rendering every property of the yoast_head_json
- f393ac9: fix: removeSourceUrl should not add a / to the beginning of the link if it's a hash link. #267
- 9aea8ab: Fix child pages with same slugs but different parent. Takes the link property in account to properly match the right page.
- d7c9871: Export block-related hooks
-
73e2dc6: Parses the style attribute of HTML elements into an object, and passes that object down as a prop through the BlocksRenderer component.
Also updates block components to pass style down as a prop to the provided components.
Closes #240
-
7e3a45e: Add React 18 and Next.js 13 support.
-
4c52fbc: Improve redirect handling in
fetchRedirect
.It now detects redirects that might cause infinite loop and ignore redirects for
wp-login.php
,wp-register.php
andwp-admin
.
-
6bd469a: add js-xss options param to wpKsesPost and exposing sanitizeFn function to BlocksRenderer
e.g
wpKsesPost( `<p data-post='${JSON.stringify(json_object)}'>Hello World</p>`, { p: ['data-post'], }, { onTag(tag, html, options) { if (options.isWhite && tag === 'p') { return html; } return undefined; }, }, ),
<BlocksRenderer html={html} sanitizeFn={html => mySanitizitationFn(html)}> {children} </BLocksRenderer>
- ad92a7a: Introducing Multisite support to the headless framework.
- 803299e: Fix previewing revisions of published posts
- ae8739d: Optimize next.js props
- ec25cdd: Fix queried object detection, account for querying by id as well
- dc7edb1: Improve seo handling. The framework now assumes the main query is the one that draws params from the URL. The main query can also be manually set. Fixes #185
- 9141bb3: Convert back-end urls in seo metadata to front-end urls
- b3d2216: Further optimize next.js props
- b3d2216: Further optimize next.js props
- ae8739d: Optimize next.js props
- ec25cdd: Fix queried object detection, account for querying by id as well
- 9141bb3: Convert back-end urls in seo metadata to front-end urls
- dc7edb1: Improve seo handling. The framework now assumes the main query is the one that draws params from the URL. The main query can also be manually set. Fixes #185
- 82ac782: Fix #210 - Some params are not taken into account by buildEndpointUrl
- 5df4762: Fix queriedObject: don't assume the first post term/author is the queried object. Moves queried object logic to fetch strategy.
- 18e408f: Introduce
swr
andfetchStrategyOptions
namespaces in the fetch options. This allow fetchOptions to be passed directly to the fetch strategy. - b9cece0: Add
type
field to the appropriate post type when previewing post/revisions - 5fb3696: Fix: Better handle queried object detection for utf8 encoded strings.
- 18e408f: Introduce
swr
andfetchStrategyOptions
namespaces in the fetch options. This allow fetchOptions to be passed directly to the fetch strategy.
- 82ac782: Fix #210 - Some params are not taken into account by buildEndpointUrl
- 5fb3696: Fix: Better handle queried object detection for utf8 encoded strings.
- 5df4762: Fix queriedObject: don't assume the first post term/author is the queried object. Moves queried object logic to fetch strategy.
- b9cece0: Add
type
field to the appropriate post type when previewing post/revisions
- dc79cc1: fix domToReact conversion of child nodes.
- 75d2adb: Introduces on-demand isr revalidation from the WordPress plugin. #184
- 8268ca5: Fix: Allow overriding images in next config
- a920bd8: Fix data.queriedObject for tags
- 9b992b9: Throw an error when trying to access data from useFetch hooks when the data is not yet available.
- 9b992b9: Throw an error when trying to access data from useFetch hooks when the data is not yet available.
- e9c7ef0: remove emotion dep from core package
- e9c7ef0: remove emotion dep from core package
- a68a9b7: Release stable version