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

Make static serviceUrls in Java instead of the js assetUrl hack #454

Closed
ComLock opened this issue Apr 26, 2022 · 7 comments
Closed

Make static serviceUrls in Java instead of the js assetUrl hack #454

ComLock opened this issue Apr 26, 2022 · 7 comments
Assignees

Comments

@ComLock
Copy link
Contributor

ComLock commented Apr 26, 2022

Make serviceUrl "root" which is on nearest site, not on every page.

Currently WRONG!
http://localhost:8080/site/starter-r4x-project/master/_/service/com.enonic.app.react4xp/react4xp/globals.js

Should be
http://localhost:8080/site/starter-r4x-project/master/mysite/_/service/com.enonic.app.react4xp/react4xp/globals.js

--
oldref: #452

@espen42
Copy link
Contributor

espen42 commented May 9, 2022

@sigdestad and I have talked about using mapped controllers instead of services. A bit more setup for devs, but easier and more stable to handle after that.

@rymsha rymsha assigned ComLock and unassigned rymsha Dec 2, 2024
@rymsha
Copy link
Contributor

rymsha commented Dec 2, 2024

Now it is a task to use lib-static. Done?

@ComLock
Copy link
Contributor Author

ComLock commented Dec 4, 2024

Actually it's not about using lib-static, it's about this hack which uses serviceUrl to make assetUrl.

return `${serviceUrl}/${assetPath}`.replace(/\/{2,}/g, '/');

@ComLock
Copy link
Contributor Author

ComLock commented Dec 4, 2024

Which in term is used in serviceUrlRoot

const serviceUrlRoot = assetUrl
.replace(/\/edit\/([^\/]+)\/([^\/]+)\/_\/asset/,'/preview/$1/$2/_/asset') // Fix BUG Assets give 404 in edit mode #476
.replace(/\/_\/asset\/.*$/, `/_/service/${app.name}/${serviceName}/`)
.replace(/\/{2,}$/, '/');

@ComLock
Copy link
Contributor Author

ComLock commented Dec 4, 2024

Actually it's not used in initServiceUrlRoot, but the one from portal is (which will be gone in xp8)

import { assetUrl as getAssetUrl } from '/lib/xp/portal';

@rymsha
Copy link
Contributor

rymsha commented Dec 10, 2024

There are test failures @ComLock
Could you look at them?

@ComLock
Copy link
Contributor Author

ComLock commented Dec 11, 2024

There are test failures @ComLock Could you look at them?

yes

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

No branches or pull requests

4 participants