Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NextJs] Sitecore Experience Edge Authentication #636

Merged
merged 8 commits into from
Mar 29, 2021
Merged

Conversation

ambrauer
Copy link
Contributor

Description

  • Implement configuration and authentication for use of Sitecore Experience Edge
  • The header sc_apikey is used for authentication on both Sitecore XM and Experience Edge
  • An app should be able to swap between XM and Experience Edge GraphQL depending on environment/config of their app
  • This includes pulling layout, dictionary, and sitemap information

Motivation

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update (non-breaking change; modified files are limited to the /docs directory)

Checklist:

  • I have read the Contributing guide.
  • My code follows the code style of this project.
  • My code/comments/docs fully adhere to the Code of Conduct.
  • My change is a code change and it requires an update to the documentation.
  • My change is a documentation change and it requires an update to the navigation.

Copy link
Contributor

@anastasiya29 anastasiya29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there be doc updates for this?

# For Sitecore XM, this is typically optional. By default, the endpoint is calculated using
# the resolved Sitecore API hostname + the `graphQLEndpointPath` defined in your `package.json`.
GRAPH_QL_ENDPOINT=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the env variables listed in the getting started docs? Do we need to document this somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anastasiya29 No, we haven't listed these anywhere other than on the the production deployment doc, since they aren't technically necessary until that time. But I do wonder if we should call them out as an alternative to using the scjssconfig.json (since you totally can with Next.js)? I can add a backlog item if you think we should.

samples/nextjs/scripts/generate-config.ts Outdated Show resolved Hide resolved
samples/nextjs/scripts/generate-config.ts Outdated Show resolved Hide resolved
samples/nextjs/scripts/generate-config.ts Outdated Show resolved Hide resolved
samples/nextjs/src/lib/GraphQLClientFactory.ts Outdated Show resolved Hide resolved
@ambrauer ambrauer merged commit 037873e into dev Mar 29, 2021
@ambrauer ambrauer deleted the feature/465351 branch March 29, 2021 20:05
anastasiya29 added a commit that referenced this pull request Aug 16, 2021
* version v16.0.0-canary.52 [skip ci]

* get rid of TODO

* version v16.0.0-canary.53 [skip ci]

* v16.1.0-canary.0

* version v16.1.0-canary.1 [skip ci]

* [JSS] Disallow file deploy for Next.js solutions (#609)

* [JSS] Disallow file deploy for Next.js solutions

* Use `sitecoreDistPath` property

* version v16.1.0-canary.2 [skip ci]

* [NextJs] Sample app configuration options for 'jss create' (#618)

* Prep for 'jss create' template customizations:

* Pull Rest/GraphQLDictionary/LayoutService creation out of page-props-factory to separate factories for each (REST by default).
* Move the [[..path]].SSR.tsx alongside default (SSG) one under /pages

* Added --fetchMode and --renderMode 'jss create' parameters to nextjs template

* fixed formatting

* Use "enum" for Fetch/RenderMode

* Parameters renamed: "fetchMode" > "fetchWith", "renderMode" > "prerender"

Co-authored-by: Adam Brauer <adab@sitecore.net>

* version v16.1.0-canary.3 [skip ci]

* [JSS] [Angular] Pull server bundle build improvements (#617)

* remove the need for the server-wrapper

* remove webpack config

* Create valid bundle

* Add empty line

* Add empty line

* Remove 'exclude' option

* Change doc related to angular bundles

Co-authored-by: Erik van 't Klooster <ao491769@achmea.nl>

* [sitecore-jss] Add GraphQLLayoutService (#614)

* [sitecore-jss] Add GraphQLLayoutService

* Change jsdoc

* add changes

* Use latest schema

* Optional cahining for `data`

* Add ability to use custom search query

* remove param

* Provide ability to format only query arguments instead of modifying response data

* version v16.1.0-canary.4 [skip ci]

* Fixed nextSteps.push

* version v16.1.0-canary.5 [skip ci]

* Update dev branch with new documentation from master (627)

This includes the new docs pages written since the 16.0.0 release and the deployment fixes that were done as part of the 16.0.0 release

------------------------------------------

* push lock's

* revert package.json

* v16.0.0

* Revert lockfileVersion on master (#610)

* Revert "push lock's"

This reverts commit e951cc4.

# Conflicts:
#	packages/sitecore-jss-angular-schematics/package-lock.json
#	packages/sitecore-jss-angular/package-lock.json
#	packages/sitecore-jss-cli/package-lock.json
#	packages/sitecore-jss-dev-tools/package-lock.json
#	packages/sitecore-jss-forms/package-lock.json
#	packages/sitecore-jss-manifest/package-lock.json
#	packages/sitecore-jss-nextjs/package-lock.json
#	packages/sitecore-jss-proxy/package-lock.json
#	packages/sitecore-jss-react-forms/package-lock.json
#	packages/sitecore-jss-react-native/package-lock.json
#	packages/sitecore-jss-react/package-lock.json
#	packages/sitecore-jss-rendering-host/package-lock.json
#	packages/sitecore-jss-tracking/package-lock.json
#	packages/sitecore-jss-update-package/package-lock.json
#	packages/sitecore-jss-vue/package-lock.json
#	packages/sitecore-jss/package-lock.json
#	packages/sitecore-pipelines/package-lock.json
#	samples/angular/package-lock.json
#	samples/nextjs/package-lock.json
#	samples/node-headless-ssr-proxy/package-lock.json
#	samples/react-native/package-lock.json
#	samples/react/package-lock.json
#	samples/sitecore-embedded-jss-app/package-lock.json
#	samples/sitecore-javascript-renderings/package-lock.json
#	samples/vue/package-lock.json

* addl lock updates from lerna reset

Co-authored-by: Adam Brauer <adab@sitecore.net>

* [Doc] [NextJs] Node extra CA certificates configuration (#612)

* Doc: Configure Sitecore CA certificates for Node.js

* Cross-link / consolidate on walkthrough-dotnetnew

* Cross-links from headless mode docs

* Fix minor lang issues

* Format UI labels, add emphasis

Co-authored-by: Adam Brauer <adab@sitecore.net>
Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* [Doc] [NextJS] Error routes (#611)

* [Doc] [NextJS] Error routes

* Update en.md

* Add improvements

* Fix punctuation

Co-authored-by: Anastasiya Flynn <flynn.github@gmail.com>
Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* [Docs] Troubleshooting page (#613)

* [Docs] Troubleshooting page

* Add lang review

* PR review improvements

* Doc wording consistency

Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

* Apply house style rule (where -> what)

We always tell WHERE the user is to do things, then WHAT to do.

* Address language and style issues

* Edit 'troubleshooting' page

Improve clarity per PR comments, add a note for checking sitecore config values, remove blurry image.

* Review language & style

* Fix hard to read sentence

* Encode ..., escape []

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>
Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

* [Docs] [NextJs] Experience Editor Integration Architecture and APIs (#616)

* EE integration architecture and APIs doc

Co-authored-by: Adam Brauer <adab@sitecore.net>
Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* Fix typo (#621)

* [Docs][NextJS] Extract Next.js telemetry info into new page (#615)

* Extract Next.js telemetry info into new page

* Update navigation

* [Doc] [NextJS] Error routes (#611)

* [Doc] [NextJS] Error routes

* Update en.md

* Add improvements

* Fix punctuation

Co-authored-by: Anastasiya Flynn <flynn.github@gmail.com>
Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* Fix route name

Co-authored-by: Illia Kovalenko <23364749+illiakovalenko@users.noreply.github.com>
Co-authored-by: Anastasiya Flynn <flynn.github@gmail.com>
Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

* typo iterfaces -> interfaces (#600)

Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

* Fix heading in note box (#622)

* Nav updates for new troubleshooting pages (#623)

Co-authored-by: Adam Brauer <adab@sitecore.net>

* Merge branch 'master' from heroku remote into updates-from-master

# Conflicts:
#	lerna.json
#	packages/sitecore-jss-angular-schematics/package-lock.json
#	packages/sitecore-jss-angular-schematics/package.json
#	packages/sitecore-jss-angular/package-lock.json
#	packages/sitecore-jss-angular/package.json
#	packages/sitecore-jss-cli/package-lock.json
#	packages/sitecore-jss-cli/package.json
#	packages/sitecore-jss-dev-tools/package-lock.json
#	packages/sitecore-jss-dev-tools/package.json
#	packages/sitecore-jss-forms/package-lock.json
#	packages/sitecore-jss-forms/package.json
#	packages/sitecore-jss-manifest/package-lock.json
#	packages/sitecore-jss-manifest/package.json
#	packages/sitecore-jss-nextjs/package-lock.json
#	packages/sitecore-jss-nextjs/package.json
#	packages/sitecore-jss-proxy/package-lock.json
#	packages/sitecore-jss-proxy/package.json
#	packages/sitecore-jss-react-forms/package-lock.json
#	packages/sitecore-jss-react-forms/package.json
#	packages/sitecore-jss-react-native/package-lock.json
#	packages/sitecore-jss-react-native/package.json
#	packages/sitecore-jss-react/package-lock.json
#	packages/sitecore-jss-react/package.json
#	packages/sitecore-jss-rendering-host/package-lock.json
#	packages/sitecore-jss-rendering-host/package.json
#	packages/sitecore-jss-tracking/package-lock.json
#	packages/sitecore-jss-tracking/package.json
#	packages/sitecore-jss-update-package/package-lock.json
#	packages/sitecore-jss-update-package/package.json
#	packages/sitecore-jss-vue/package-lock.json
#	packages/sitecore-jss-vue/package.json
#	packages/sitecore-jss/package-lock.json
#	packages/sitecore-jss/package.json
#	packages/sitecore-pipelines/package-lock.json
#	packages/sitecore-pipelines/package.json
#	samples/angular/package-lock.json
#	samples/angular/package.json
#	samples/nextjs/package-lock.json
#	samples/nextjs/package.json
#	samples/node-headless-ssr-proxy/package-lock.json
#	samples/node-headless-ssr-proxy/package.json
#	samples/react-native/package-lock.json
#	samples/react-native/package.json
#	samples/react/package-lock.json
#	samples/react/package.json
#	samples/sitecore-embedded-jss-app/package-lock.json
#	samples/sitecore-embedded-jss-app/package.json
#	samples/sitecore-javascript-renderings/package-lock.json
#	samples/sitecore-javascript-renderings/package.json
#	samples/vue/package-lock.json
#	samples/vue/package.json

* origin and heroku remotes has difference app roots, so these changes are supposed to  be on docs/package.json

Co-authored-by: illiakovalenko <iki@sitecore.net>
Co-authored-by: illiakovalenko <zlatoborodyi@gmail.com>
Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>
Co-authored-by: Adam Brauer <adab@sitecore.net>
Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>
Co-authored-by: Illia Kovalenko <23364749+illiakovalenko@users.noreply.github.com>
Co-authored-by: Calvin Williams <40271790+sc-CalvinWilliams@users.noreply.github.com>

* version v16.1.0-canary.6 [skip ci]

* [JSS] [React Native] Update packages, fix issues (#624)

* Add changes

* add changes

* Fix issues

* update packages

* Push package-lock

* Add release note

* update react-native svg in sitecore-jss-react-native

* Updated env setup doc link / tab name

* Fix component params example for connected mode - all params will come in as string from layout service

* Fix image sample 'src' prop type for disconnected - this will be number in disconnected, string in connected

* Fixed tunnel for use of secure (https) Sitecore endpoints. Updated to latest ngrok.

* Release note updates

* Added height / width to plain image example (these are required for network images i.e. connected mode). Removed srcSet / adaptive image example since it's not supported.

Co-authored-by: Adam Brauer <adab@sitecore.net>

* version v16.1.0-canary.7 [skip ci]

* NPM package security audit & updates (#633)

* Dependency audit - root: Removed metro, updated ini

* Dependency audit - package updates (all semver-compatible, only low remaining)

* Dependency audit - nextjs sample

* Dependency audit - react, sitecore-embedded-jss-app, sitecore-javascript-renderings, vue samples

* Dependency audit - e2e

* lock file updates

Co-authored-by: Adam Brauer <adab@sitecore.net>

* version v16.1.0-canary.8 [skip ci]

* [Docs][NextJs] Account for new `fetchWith` and `prerender` configuration options for 'jss create' (#620)

* Progress on doc updates for SSG/SSR & REST/GraphQL app modes

* parameter rename

* Another batch of updates

* Added 'Switching between REST and GraphQL' doc, minor cleanup

* Update "Tracking & Analytics Overview and Architecture" docs

Explicitly state that SSR is required for personalization, to avoid confusion

* Add jss create to CLI reference docs

* Add reference to CLI doc

* Added clarification to analytics support (SSR with Sitecore Layout Service REST API only) to "How is Next.js Different" doc

* Provide more detailed example for `jss create` with optional params

* Concentrate REST & SSR info in a pre-requisites section & clean up

* Re-work intro, adjust heading levels

* Drop parens

* Change wording

* Add CLI reference link, add headings for the switch sections

* Change case for consistency

* Add note about visitor consent for tracking

* Change heading

Co-authored-by: Adam Brauer <adab@sitecore.net>
Co-authored-by: Anastasiya Flynn <flynn.github@gmail.com>
Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* 459490 GraphQL-based dictionary service (#631)

Create new GraphQL-based dictionary service implementation in sitecore-jss

GraphQLDictionaryService (implements DictionaryService interface)

using the layout query to get site root item
using the search query to get all dictionary phrases in the site (by template)
accounting for search query pagination
RestDictionaryService and RestDictionaryService inherit common functionality from new abstract class DictionaryService
This branch also has refactoring to organize our services classes better (not that we have more of them) and to make files in sitecore-jss follow consistent naming conventions.
Renamed classes:
LayoutService -> RestLayoutService
LayoutServiceInstanceConfig -> RestLayoutServiceConfig
DictionaryService -> RestDictionaryService
DictionaryServiceConfig -> RestDictionaryServiceConfig
DictionaryServiceData -> RestDictionaryServiceData (and removed from export since it's not used in the sample apps)
HtmlJsonFetcher -> HtmlDataFetcher (renamed because the return type is arbitrary and not guaranteed to be JSON)

New classes:
GraphQLLayoutService,
GraphQLLayoutServiceConfig

----------------

* Create utils/routingUtils.ts

Move query string formatting out of the dataApi file, and into a general routing util fil since it can be used by other APIs too.

* Combine util functions into a common namespace

Now all util functions are available from the 'util' module exported from sitecore-jss

* extract getUrl

* Standardize file naming in sitecore-jss

* Standardize file naming in sitecore-jss

* Everything in the 'data-fetcher' module is coupled to Axios, so lets rename it to 'axios-fetcher' and use 'data-fetcher' for the underlying generic interface

* Everything in the 'data-fetcher' module is coupled to Axios, so lets rename it to 'axios-fetcher' and use 'data-fetcher' for the underlying generic interface

* Rename type HttpJsonFetcher -> HttpDataFetcher

This is a generic type, so there is no guarantee that the result
is JSON. The result can be any type.

* Rename the sample app's data-fetcher to data-fetcher-factory to better describe what it's doing and to make it consistent with our other files

* whitespace and todo for later

* Rebase with dev and move some of the refactoring to a separate branch

* TODOs for later

* This is left-over from the refactoring that moved to another branch

* GraphQLDictionaryService implementation

* Add pagination and error handling to GraphQL Dictionary service; split the 2 dictionary services into separate files; create base class for dictionary services to share code

* Update graphql-request-client - remove private passthrough function that isn't needed; add error handling

* Add caching to graphql dictionary service

* linting

* Give name/date context to TODOs

So we know who to bug 😸

* Update references to renamed exports

* Use lower case for GUIDs

* Show more data in graphql client errors

* Ignore *.eslintcache

* GraphQL dictionary service now fetches the root item ID, so it does not have to be provided explicitly

* lint

* unit tests

* Undo accidental commit

* Use Object.freeze on dictionary service constants

* Rename DictionaryService methods - getCacheValue and setCacheValue

* Add doc comments to GraphQLDictionaryServiceConfig

* GraphQLDictionaryService - extract default pageSize into 'defaults' object

* Rename graphql.dictionary-service to graphql-dictionary-service. Rename rest.dictionary-service to rest-dictionary-service.

* Rethrow error from promise chain in graphql-request-client

* Improve comments in data-fetcher.ts

* Comments

* lint

* fetchDictionaryData - do not use make return value depend on cache

* Revent renaming of src\lib\data-fetcher.ts

* Update comments and variable name

* jssAppTemplateId should be a required variable in the getRoot query

* capitalize DEFAULTS object name

* Rename appName -> siteName

* version v16.1.0-canary.9 [skip ci]

* [JSS] [Angular] Update to Angular 11 (#635)

* changes

* update to 11.2.6

* Fix angular schematics

* Update apollo client

* Upgrade typescript-eslint

* upgrade angular-eslint

* update packages

* upgrade test packages

* Update sitecore-jss-angular packages

* Upgrade angular-devkit

* FIx error: JssModule can't read property 'emod' of undefined

* Add chalk, fix deprecations

* Push lock files

* Remove deprecated extractCss

* Release notes

* Fix typo

* Fix ini (low severity) vulnerability

* Edit release-notes

Co-authored-by: Adam Brauer <adab@sitecore.net>

* version v16.1.0-canary.10 [skip ci]

* [NextJs] Sitecore Experience Edge Authentication (#636)

* Added 'sc_apikey' header authentication for GraphQL layout and dictionary services

* Added sc_apikey header / param to GraphQL sitemap service. Started sample app updates.

* Fixed siteRootQuery error: Variable "$language" of type "String" used in position expecting type "String!"

* Generate environment variables for computed config values as well

* Added GRAPH_QL_ENDPOINT to .env file and Vercel deployment doc

* PR feedback: use endpoint const, get rid of "calculated config" verbiage

* Removed prettier comment

* PR feedback: removed "Edge" usage for XM references

Co-authored-by: Adam Brauer <adab@sitecore.net>

* version v16.1.0-canary.11 [skip ci]

* [node-headless-ssr-experience-edge] Add new starter template for SSR from Experience Edge (#628)

* Push first changes

* commit

* push files

* Exclude sample from e2e

* push package-lock

* update readme.md

* Update readme

* update config

* update

* refactoring

* Add changes

* Remove rewrite_exclude_urls

* Added API_KEY

* add todo for testing of graphql queries

* Change validation message

* Change canary version

* Push package-lock

* Add changes after review

* Update pre-requisite

* Update canary build

* Add changes related to sc_apikey header

* Update config apiKey description

* Update sc_apikey header description

* Update canary version

* Push lock files

* Fix UT

* version v16.1.0-canary.12 [skip ci]

* [sitecore-jss] [DictionaryService] fix memory cache (#639)

* version v16.1.0-canary.13 [skip ci]

* Next.js create param info for dotnet new template

* [sitecore-jss] [nextjs] Use consistent not found handling for layout requests (#640)

* Align not found return type

* Fix ts types

* add UT

* take response data when 404

* cover by UT

* covery by UT

* Add updates

* Make some methods private, cover error case by UT

* version v16.1.0-canary.14 [skip ci]

* [Next.js] Remove Apollo dependency for GraphQL (#642)

* Use typed-document plugin instead of apollo. Remove apollo-client

* Add typed-document-node package, required

* Push package.lock

* Change jsdoc

* version v16.1.0-canary.15 [skip ci]

* [NextJS] Handle change to route type to allow nulls. (#643)

Build context object in [[...path]] instead of in Layout, since the former is aware of whether route is null or not

* version v16.1.0-canary.16 [skip ci]

* [JSS] [NextJs] Sitemap query limits to 10 by default (#644)

* whitespace

* rebase onto dev

* Add pagination to sitemap service

* improve comments

* Add more error handling to graphql-sitemape-service

* unit tests & lint

* Release notes

* Improve comments and type checking

* Fix merge issues

* Change visibility of GraphQLSitemapService.fetch to protected

* version v16.1.0-canary.17 [skip ci]

* [JSS] [NextJs] Debug Logging (#645)

* Low-level http request/response debug logging ("sitecore-jss:http" namespace) for both GraphQL (`graphql-request-client.ts`) and REST/fetch (`axios-fetcher`). Feature-level logging for dictionary and layout ("sitecore-jss:dictionary" and "sitecore-jss:layout" namespaces).

* Debug log tests for http logging

* Use object formatting, Axios 'toJSON' if available for errors

* Sitemap and experience editor feature-level logging

* Add rootItemId.toLowerCase() back to GraphQL sitemap query

* Added documentation

* Added to release notes

* PR feedback: SDKs > npm packages, added note about server-side only logs

* PR feedback: Centralized debug 'debuggers' in sitecore-jss

* Allow debugger injection into low-level http wrappers (axios-fetcher and graphql-request-client) so that these request/response logs can appear under feature-level namespaces.

* Updated docs

* Fix lint error

* version v16.1.0-canary.18 [skip ci]

* Renamed debug logging namespace "sitecore-jss:experience-editor" > "sitecore-jss:editing"

* version v16.1.0-canary.19 [skip ci]

* [Docs][469075] Add notes on compatibility & CLI example for older JSS releases (#634)

* Update params, include example for specific release version

* Add version compatibility info

Include links to the compatibility table and to the CLI reference (updated with an example for creating an app using a previous version of JSS).

* Fix typo

* Add version compatibility note and link to table

* Add compatibility note

* Add note on Sitecore and JSS versions

* Change versioning wording

* [NextJs] GraphQL schema updates and fragment data generation removal (#648)

* Removed GraphQLFragmentTypes.json and corresponding script to generate. This is no longer needed with our removal of Apollo in the sample app. Also, added apikey to the introspection fetch and switched to use our GraphQLRequestClient as opposed to cross-fetch.

* Updates for item children GraphQL edge schema change (now uses item search results pattern vs an array of items).

* version v16.1.0-canary.20 [skip ci]

* Added DEBUG_MULTILINE to allow switching from %o (pretty-print single line) to %O (pretty-print multiple line) formatting (#649)

* version v16.1.0-canary.21 [skip ci]

* NPM package security update: 'url-parse' and 'y18n' (#651)

* 'url-parse' dependency removal / upgrade to address vulnerability with v1.4.7 (https://nvd.nist.gov/vuln/detail/CVE-2021-27515)

* Address y18n vulnerability (high): https://www.npmjs.com/advisories/1654

* lock file updates (npm run reset)

* Remove url-parse from sitecore-jss-angular, remove @types from sitecore-jss-forms

* Push lock files

Co-authored-by: illiakovalenko <zlatoborodyi@gmail.com>

* version v16.1.0-canary.22 [skip ci]

* [Doc] Remove `remove language from package.json` step in `Walkthrough: Using next export` (#658)

* Update PULL_REQUEST_TEMPLATE.MD

Removed checklist

* Update PULL_REQUEST_TEMPLATE.MD

Combined description and motivation sections.
Reworded Testing section title

* version v16.1.0-canary.23 [skip ci]

* CONTRIBUTING refresh: node/npm versions, 'dev' branch now default (#673)

* version v16.1.0-canary.24 [skip ci]

* [sitecore-jss-nextjs] Links inside RichText control cause page to be loaded twice (#659)

* Fix internal links initialization

* Add doc

* version v16.1.0-canary.25 [skip ci]

* [Angular] Extend description for Lazy Loading component (#674)

* version v16.1.0-canary.26 [skip ci]

* Feature/469713 (#656)

* Refactoring - avoid duplicating getQueryString and other URL resolving logic; add unit tests for this function

* Reorganize modules related to layout service - move them into their own folder and separate rest/graphql, similar to what we did with dictionary modules

* remove 'data-api' file to improve the dependency hierarchy 

* Use proper querystring types from @types/node/querystring

* break up util functions - isolate EE utils in 'experience-editor' file; break out logic for resolving app root into its own util for reuse in sitemap

* Move test data for unit tests into a separate json file

* Update properties in sitecore-jss/package.json

* Enable syntax highlighting on graphql string via prettier

* set noUnusedLocals to true in sitecore-jss-nextjs

Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

* version v16.1.0-canary.27 [skip ci]

* Bug/475365 (#679)

* Fit error about missing http module - apparently importing and then exporting a lib in this manner is not ok

* Fix circular dependency in src/utils/experience-editor

* Add index/ts file under /i18n for easier imports

* Add a table comparing API of sitecore-jss 16.0 vs 18.0 to migration guide and fix a couple missing exports

* version v16.1.0-canary.28 [skip ci]

* [node-headless-ssr-proxy + Angular sample] Error in console when refresh /graphql page (#680)

* [node-headless-ssr-proxy + Angular sample] Error in console when refresh /graphql page

* Update release notes

* version v16.1.0-canary.29 [skip ci]

* Feature/475116 (#682)

* Update SitePageQuery (used by sitemap) to use a variable for "_hasLayout" clause

* Add "contains operator" to our graphql search() queries and start docs for edge-specific graphql requirements

* Add query example to docs

* version v16.1.0-canary.30 [skip ci]

* [sitecore-jss-forms] Fix for multi-valued fields with pre-filled form data (#677)

* Fix issue where pre-filled (default) form data isn't removed for multi-valued fields when user de-selects values.

* Added release note

* version v16.1.0-canary.31 [skip ci]

* Fix lint issues

* Push package lock

* Edit line endings before write to file, force to use CRLF

* Extend description

* Extend description

* Edit line endings for Vue sample

* version v16.1.0-canary.32 [skip ci]

* [sitecore-jss] [mediaApi] `updateImageUrl` fix for invalid hash errors on Sitecore (#681)

* media-api updateImageUrl update - *only* switch to JSS media handler prefix if image params are sent. Otherwise, the original media URL should be returned. Fixes hash errors from appearing in Sitecore logs ("ERROR MediaRequestProtection: An invalid/missing hash value was encountered.")

* added release note

* Don't modify 'params' parameter!

* Also check 'params' object keys b/c of cases where an empty object is passed in by the frameworks usage (and in fact the srcset logic appears to do that)

* version v16.1.0-canary.33 [skip ci]

* Dependency upgrades - High severity vulnerabilities (#685)

* vulnerability updates: ssri (https://nvd.nist.gov/vuln/detail/CVE-2021-27290), ini (https://nvd.nist.gov/vuln/detail/CVE-2020-7788), y18n (https://nvd.nist.gov/vuln/detail/CVE-2020-7774), lodash (https://nvd.nist.gov/vuln/detail/CVE-2021-23337)

* Semver-compatible vulnerability updates for /docs (just keep on life support for now)

* version v16.1.0-canary.34 [skip ci]

* Bug/472144 (#683)

* Add default language for node-headless-ssr-experience-edge

* Add todo to fix similar issue in headless-ssr-proxy

* Update README.md

* version v16.1.0-canary.35 [skip ci]

* Bump lerna version to match ci / lock version (3.22.x) for local development. Misc lock files updated (after reset).

* version v16.1.0-canary.36 [skip ci]

* [node-headless-ssr-experience-edge] Update readme (#688)

* version v16.1.0-canary.37 [skip ci]

* Add dataApi, mediaApi back to sitecore-jss-nextjs package export

* version v16.1.0-canary.38 [skip ci]

* [NextJs] Switch sample app source to GraphQL by default (#689)

Switch the source code default fetch for layout and dictionary data to GraphQL. REST will remain the default for jss create (--fetchWith). Updates to docs as needed.

* version v16.1.0-canary.39 [skip ci]

* [JSS] Address high severity vulnerabilities (#691)

* Update packages

* Uppdate other packages

* Revert sitecore-jss-nextjs `next` package version

* version v16.1.0-canary.40 [skip ci]

* Feature/467450 - Edge GraphQL query & services updates (#692)

Functional changes:
* Update introspection, and connected/disconnected GraphQL components in Next sample to account for latest Edge scheme. The change is that `language` is required in all queries. This fixes the broken build.

Non-functional devEx improvements:
* Add CacheClient and GraphQLClient interfaces to allow implementations to override which 3rd party libs are used by services.
* Pull shared functionality related to using `search` query (ie handling pagination) into new SearchQueryService; update GraphQLDictionaryService and SitemapService to use this service.
* Make it easier to customize our services by changing access level of methods from private to protected

Misc changes:
* [sitecore-jss] Move app root query functionality from /utils to /graphql
* Fix typo in docs

* version v16.1.0-canary.41 [skip ci]

* Add language fallback settings to nextjs sample config (#695)

* version v16.1.0-canary.42 [skip ci]

* [NextJs] Added IncludeServerUrlInMediaUrls "default" configuration to Next.js sample app (necessary for Sitecore GraphQL Edge) (#696)

* version v16.1.0-canary.43 [skip ci]

* [sitecore-jss] [graphql-dictionary-service] use "Key" and "Phrase" capitalized (#697)

* version v16.1.0-canary.44 [skip ci]

* Fix typo

* GraphQLSitemapService - allow overriding of query and search service (#705)

* version v16.1.0-canary.45 [skip ci]

* [Docs][474350] Document the new starter template for SSR (#694)

* Document node-headless-ssr-experience-edge

* Add nav item for SSR with Edge

* Emphasize the experimental nature of the template

* Specify that non-next.js apps use legacy/non-Edge schema.

* Fix typo, improve clarity

* Add ssr-edge sample to list of experimental templates

* Review language

* Add third-party note on Node.js as per PBI 435247

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* Use correct 'layout' debug namespace for graphql-layout-service.

* version v16.1.0-canary.46 [skip ci]

* Fix merge conflict - this comment was in the wrong place

* version v16.1.0-canary.47 [skip ci]

* [sitecore-jss-react] [Text] Render value instead of array of single value when value doesn't contain line breaks (#714)

* version v16.1.0-canary.48 [skip ci]

* [sitecore-jss] Rest Layout Service - Allow override of "named" JSS configuration (#716)

* [RestLayoutService] Allow override of "named" JSS configuration

* Add UT

Co-authored-by: illiakovalenko <zlatoborodyi@gmail.com>

* version v16.1.0-canary.49 [skip ci]

* Allow to publish canary for release branches

* version v16.1.0-canary.50 [skip ci]

* [Fix] Update Text components to accept number values (#713)

* Update Text components to accept number values

* [sitecore-jss-react] [Text] Render value instead of array of single value when value doesn't contain line breaks

* PR feedback - handle zero number value, added tests to cover. Also added tests to cover empty string (should not render).

* Update react/nextjs number fields in styleguide route manifest

Co-authored-by: illiakovalenko <zlatoborodyi@gmail.com>

* version v16.1.0-canary.51 [skip ci]

* Include release/* branches to be triggered

* version v16.1.0-canary.52 [skip ci]

* Trigger azure pipeline on the branch which targets release branch

* version v16.1.0-canary.53 [skip ci]

* Apply workaround, b/c SourceBranchName doesn't contain `release` prefix, it takes last part

* Use variable

* Apply fix for branchName

* version v16.1.0-canary.54 [skip ci]

* v18.0.0

* version v18.0.1-canary.0 [skip ci]

* v18.0.0-canary.0

* version v18.0.0-canary.1 [skip ci]

* [Doc] [NextJS] GraphQL + Disconnected mode compatibility (#717)

* [Doc] [NextJS] GraphQL + Disconnected mode compatibility

* Add route

* Review language and style

* Remove duplicate export

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* [Docs] Align with styleguide, fix incomplete sentence (#709)

* Fix incomplete sentence

* Review and update according to docs styleguide

* Change case for headings

Our doc styleguide requires all heading use sentence case (instead of title case).

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* Merge pull request #708 from Sitecore/docs/435247

[Docs] Explicitly mention that NodeJS is a third-party technology.

* Merge pull request #710 from Sitecore/docs/445595

[Docs] Change starter->sample and associated changes + small lang & style fixes

* Merge pull request #719 from Sitecore/docs/445596

[445596][Docs] Replace jss.sitecore.net with jss.sitecore.com

* [Docs][Next.js] Add video walkthrough (#729)

* Add video walkthrough

* Update iframe src with correct embed url

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* [Docs] Update README with samples entry for Next.js and highlight features (#632)

* Update with samples entry for Next.js and highlight features

* Update product name

* Drop mention of create-next-app

* Fix small grammar issues

* Update README.md

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* version v18.0.0-canary.2 [skip ci]

* Update Next.js sample config - layoutServiceConfiguration="default" (#722)

* Update Next.js sample config - layoutServiceConfiguration="default"

* Update samples/nextjs/sitecore/config/JssNextWeb.config

Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

* version v18.0.0-canary.3 [skip ci]

* [All frameworks] Execute correct detection of disconnected or connected mode (#732)

* version v18.0.0-canary.4 [skip ci]

* Revert "[All frameworks] Execute correct detection of disconnected or connected mode (#732)"

This reverts commit 23bb5ec.

* version v18.0.0-canary.5 [skip ci]

* [Vue] Correct detection of disconnected mode

* Add walkthrough for customizing static paths (#739)

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* [Docs] Add Edge-related material (#740)

* Move video demonstration for better fit

* Add link to Edge docs

* Add Edge alternative to publish:end hook config

* Add link to API provisioning docs for Edge

* Add Sitecore XM detail to publish:end webhook

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* [Docs][Next.js]Fix step for deploying Next.js items to Sitecore [479849] (#741)

* Fix step for deploying Next.js items to Sitecore

* Clarify how to deploy a Next.js app to Sitecore

* Push hash to history if present, account for target other than link

* Handle hash when routing

* Add flags docs/data/routes/docs/nextjs/getting-started-nextjs/walkthrough-jsscreate/en.md

Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>
Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>

* [Docs] Update services  (#751)

* Separate content and move getStaticPaths

Moves getStaticPaths documentation under "Page Routing".
Redirects from old to new location.
Fixes cross-references.
Removes GraphQLSitemapService which should go in its own doc.

* Add nav and page for GraphQLSitemapService

* Add EXPORT_MODE variable to steps

* Use ManifestInstance

* Update deprecated signature

* Update doc title

* Link to first mention

* [483268] Document graphQL query error for Next.js + SXA

* Update GraphQLSitemapService documentation

* Update navigation item

* Add Services & APIs overview for fundamentals

* Split back- and front-end layout service, update content

Splits the Layout Service section into the front- and back-end parts for
easier management of changes.

Updates nav.

Adds redirects as needed.

* Fix typos

* Add link to Next.js app lib as example of service factories

* Clarify in the heading this is the REST layout service

* Revert move of getStaticPaths topic

* Make example framework agnostic

* Remove duplicate heading

* Fix typo

* Remove mystery variable

* Re-word factory description

* Clarify JSS clients interact with Sitecore Headless services

These types of distinctions become increasingly important as we separate server components from JSS services

* Reorganize Layout overview

* Add redirect to overview for Layout service

Since server components Layout service and JSS one were mixed in a single doc, we don't know which one old links out in the world were meant to reach.
By pointing at the overview, devs can then pick the one they are interested in.

* Refactor Dictionary service docs

Split Sitecore from JSS
Add redirects
Update nav

* Update title

* Fix indentation

* Specify other services/apis

* Fix redirect for layout service landing

* Update layout service links

* Remove dataApi reference

* Expand description and provide GraphQL examples for Dictionary service

* Clean up Headless Dictionary Service description

* Expand description and provide GraphQL example for Layout service

* Update links to dictionary service documentation

* Enrich dictionary overview with info about GQL and links

* Incorporate doc update from PR#744

* Remove duplicate menu item

* Update docs/data/routes/docs/fundamentals/services/dictionary/overview/en.md

Adds missing comma

Co-authored-by: Anastasiya Flynn <flynn.github@gmail.com>

* Move Services higher in the navigation

* Change tone

* Improve clarity of data fetching options

* Change endpoint / product order to match bullet points

* Specify the package that provides the dictionary API

* Elaborate JSS Dictionary API description

* Add note on sample app

* Get personal

* Remove obscure references to back-end concepts

* Add returned data example

* Change "route data" to "layout data" + small language changes

* Link to query definition in branch src file

* Re-arrange some content

* Specify name for Edge Preview endpoint and add original gql endpoint

* Add missing empty line between heading and quote

* Clarify that the tracking parameter is only intended for Sitecore XP

* [487542] Clarify required version of Sitecore and Headless Service for Next

* [486092] Update troubleshooting: Next.js app does not render on Vercel

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>
Co-authored-by: Anastasiya Flynn <flynn.github@gmail.com>

* [Docs] Generate ref docs for jss and nextjs sdks (#766)

* Generate ref docs for jss and nextjs sdks

* Regenerate docs with updated readmes

* Update readmes and location of ref-docs

* Generate ref-docs without duplicating package readme

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* version v18.0.0-canary.6 [skip ci]

* Add ref docs links (#767)

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* Fix broken links to main docs (#770)

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* Add example and config for Next.js + small fixes (#769)

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* 18.0.0 Release Notes (#779)

* Update release notes for v18. Create CHANGELOG file.

* Add link to Sitecore Experience Edge schema docs

* Link to JSS Layout / Dictionary APIs

* Add link to sitecore-jss and sitecore-jss-nextjs ref docs

* Fix Edge heading and add link to docs

* Add section on docs and update links

* Drop "API"

* Wrap param names in backticks

* Add link to CLI docs for create

* Improve links to Edge docs sections

The Edge docs were published today so we now have access to section IDs

* Update links to Sitecore docs

Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>

* version v18.0.0-canary.7 [skip ci]

* Update "Found a problem" link in docs to use release/18.0.0 branch instead of master (#780)

* Typo

Co-authored-by: Automated Build <builds@sitecore.com>
Co-authored-by: Nick Wesselman <nwe@sitecore.net>
Co-authored-by: Adam Brauer <adab@sitecore.net>
Co-authored-by: Illia Kovalenko <23364749+illiakovalenko@users.noreply.github.com>
Co-authored-by: Adam Brauer <400763+ambrauer@users.noreply.github.com>
Co-authored-by: Erik van 't Klooster <ao491769@achmea.nl>
Co-authored-by: illiakovalenko <iki@sitecore.net>
Co-authored-by: illiakovalenko <zlatoborodyi@gmail.com>
Co-authored-by: Anca Emcken <AncaIO@users.noreply.github.com>
Co-authored-by: Calvin Williams <40271790+sc-CalvinWilliams@users.noreply.github.com>
Co-authored-by: Nick Wesselman <27013789+nickwesselman@users.noreply.github.com>
Co-authored-by: Coby Sher <63015754+CobyPear@users.noreply.github.com>
Co-authored-by: Anca Emcken <1617798+ancaemcken@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants