18.0.0
New Features
All JSS services have been upgraded to support Sitecore Experience Edge GraphQL schema.
[sitecore-jss]
[sitecore-jss-nextjs]
[samples/nextjs]
- Update Sitecore configuration patches with relevant Edge-specific definitions.
- The sample uses Edge schema by default.
- #695 Add settings for language fallback with Experience Edge.
- #696 Add
IncludeServerUrlInMediaUrls
"default" configuration to avoid exposing the Sitecore server publicly when using Experience Edge.
[samples/react]
[samples/angular]
[samples/vue]
The samples can also utilize Sitecore Experience Edge. A new sample [samples/node-headless-ssr-experience-edge]
has been adeded to demonstrate how to configure this. Read docs.
New & Improved Service Classes
[sitecore-jss]
GraphQLDictionaryService
is a new service for fetching dictionary data using GraphQL Read docs.GraphQLLayoutService
is a new service for fetching layout data using GraphQL Read docs.- #716 Allow overriding which "named" Layout Service configuration (from Sitecore config) is used by JSS.
- Allow overriding 3rd party dependencies in JSS services that depend on 3rd party functionality (GraphQLLayoutService, RestDictionaryService, GraphQLDictionaryService, GraphQLSitemapService).
[sitecore-jss-nextjs]
- Make
GraphQLSitemapService
easier to customize by allowing overrides of default options. (#682, #705)
Other Notable Improvements
[sitecore-jss]
Enable debug logging for JSS services using the debug module. Read docs.- New options in
jss create
command. Read docs.
[samples/react-native]
(#624)
- Add shared
<Layout/>
component in order to have shared navigation panel. - Make Sitecore logo in header is touchable and will navigate to Home page when click on it.
- Remove usage of
dataConversation
.
Bug Fixes
[sitecore-jss]
- Fix issue with dictionary phrases not being cached when caching is enabled (#639)
mediaApi.updateImageUrl
now only switches to JSS media handler prefix if imageParams
are sent. Otherwise, the original media URL is returned. Fixes hash errors ("ERROR MediaRequestProtection: An invalid/missing hash value was encountered.") from appearing in Sitecore logs (#681)
[samples/nextjs]
[samples/react]
[samples/vue]
- Fix issue where using the
jss scaffold
generated files with inconsistent line endings (#684) - Update Text components to accept number values (#713)
[sitecore-jss-nextjs]
- Fix issue with
getStaticPaths
only pre-rendering the first 10 pages (638) - Fix issue where links inside RichText controls caused pages to load twice (659)
[sitecore-jss-react]
Render value instead of array of single value when value doesn't contain line breaks (714)
[sitecore-jss-react-native]
(#624)
- [Image] Pass Object
style
type for SvgUrI
instead of Array. - [Date] Always render
<HtmlView/>
if editable
is provided.
[samples/react-native]
(#624)
- Fix Styleguide-FieldUsage-Date not working in connected mode.
- Styleguide-FieldUsage-Image: Fix incorrect
src
prop type in disconnected mode. Fix 'Plain image' example in connected mode. Remove unsupported 'Srcset image' adaptive example. - Styleguide-ComponentParams: fix incorrect
params
prop types in connected mode. - Fix connected tunnel mode for secure (https) Sitecore endpoints.
[samples/node-headless-ssr-proxy]
Fix how header value for 'accept-encoding' is set. This resolves an issue in the Angular sample where the /graphql page caused a console error (#680)
[sitecore-jss-forms]
Fix issue where pre-filled (default) form data isn't removed for multi-valued fields when user de-selects values (#677)
Breaking Changes
[sitecore-jss-react-native]
Removed dataConversation
, since editable
property not used in disconnected
mode. (#624)
[samples/angular]
Upgrade angular
to v11. (#635)
[samples/nextjs]
Change how a custom query can be used in GraphQLSitemapService. Previous way: pass a formatSearchQuery
function to fetchExportSitemap
or fetchSSGSitemap
. New way: extend the GraphQLSitemapService
class and override the fetchSitemap
method. (#638)
- As part of adding support for Experience Edge, Sitecore XM's graphQL API was updated to mirror Experience Edge's schema. The following updates in JSS
- [sitecore-jss-nextjs] Update sitemap query to comply with changes to the GraphQL API
- [samples/nextjs] Update generated TypeScript models for GraphQL components to comply with changes to the GraphQL API
With the added support of GraphQL endpoints, the API surface area of JSS has essentially doubled. As a result, some reorganizing was done in the base packages, which causes breaking changes for how some services, classes and functions are exported. If you have imports from JSS base packages in your project, they may need to be updated per the migration guide table.
Sitecore JSS 16.0 for Sitecore 10.1
Upgrading
There are migration instructions from JSS 15-based applications.
Breaking changes
- PR #485 [JSS CLI] Add --config argument to specify the path to
scjssconfig.json
file. resolveScJssConfig
now accepts arguments as an object instead of using individual arguments. - PR #460 [sitecore-jss-react] Fix return type of
ComponentFactory
to allow a component definition instead of an instantiated component. ComponentFactory
returns ComponentType | null
instead of Component
. - PR #459 [sitecore-jss-react] Change propType of
missingComponentComponent
from React.SFC
(deprecated) to React.FC
. - PR #538 [sitecore-jss-react] Change propType of
errorComponent
from React.SFC
(deprecated) to React.FC
. - PR #517 [packages/samples] Migrate TSLint (deprecated) to ESLint.
New Features & Improvements
- Documentation Add support for Next.js framework. 🎉🎉🎉
- Commit [sitecore-jss] Add
RestDictionaryService
to fetch dictionary data using the Sitecore Dictionary Service REST API, and RestLayoutService
to fetch layout data using the Sitecore Layout Service REST API. - PR #511 [sitecore-jss] Add
AxiosDataFetcher
to provide a default data fetcher implementation which can be used in sample apps. - PR #530 [sitecore-jss] Add
GraphQLRequestClient
to provide the ability to execute GraphQL queries. - PR #525 [sitecore-jss-react] Enable
SitecoreContext
to support TypeScript generics. - PR #508 [sitecore-jss-react] Add the
useSitecoreContext
hook. - PR #542 Add environment variable support via an
.env
file to the CLI.
Bug Fixes
- PR #548 [sitecore-jss-dev-tools]
jss deploy
doesn't exit on success. - PR #541 [sitecore-jss-dev-tools][sitecore-jss-cli] Replace old and security vulnerable
request
and axios
NPM packages with latest version of axios
(>=0.21.1). - PR #506 [React sample]
Cannot read property 'sitecore' of null
, when 404 and routeData is null. - PR #575 [sitecore-jss-react] Specifying a custom error component via the Placeholder's
errorComponent
prop caused an "Invalid prop" error. - PR #477 [sitecore-jss-proxy] Prevent passing 'qs' as 'undefined' in
rewriteRequestPath
. - PR #459 [sitecore-jss-react] Fix propType of
missingComponentComponent
, resolving an issue with custom "Missing Component" components not working. - PR #538 [sitecore-jss-react] Fix propType of
errorComponent
, resolving an issue with custom "Error" components not working. - PR #521 [packages/samples] Upgrade react, react-dom.