adobe / adobe/aem-spa-project-core
Default to using window.location for the page path
- Dominant language
- Java
- Stars
- 30
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Currently the only way to pass a specific route path is to include it in the SPA page property. This is not efficient if there are a number of pages that will be made editable. See [this code line](https://github.com/adobe/aem-spa-project-core/blob/d5f803905d505318fe1c6cdbedc0545c54991a39/ui.apps/src/main/content/jcr_root/apps/spa-project-core/components/remotepagenext/clientlibs/js/remotepagenext.js#L62) for more details.
Ideally we would use the window.location as the default way of getting the page path, and implementing a [Next.JS middleware](https://nextjs.org/docs/advanced-features/middleware) to rewrite the /content/*/ path into an appropriate route.
If customers want to provide an explicit route then they should do that via a second SPA page property (which will allow for a consistent base remote URL configuration)
Contributor guide
Research direction
Start with ui.apps/src/main/content/jcr_root/apps/spa-project-core/components/remotepagenext/clientlibs/js/remotepagenext.js at the referenced route-path handling. Review the Next.js middleware approach for rewriting /content/*/ paths and determine how an explicit route should be supplied through a second SPA page property. Done means window.location is the default while explicit routes remain supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100