-
Notifications
You must be signed in to change notification settings - Fork 54
feat: Eliminate /studio-app prefix in app renderer
#27
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…renderer's entry point
- the api request was causing studio_router to be called after app router is called
/studio-app prefix in app renderer
- Redirect to the same route to trigger re-evaluation with new routes
- onActivated & watcher both were trying to insert a page asynchronously
- renderer is accessible on the webserver port due to WebsiteGenerator, pass this base URL in page context
… the entry point - as recommended in https://vite.dev/guide/backend-integration - this also skips the build step to copy app renderer entry and makes the renderer somewhat faster
…uter - handle leading slash in page options - so that user doesn't have to type it for every route
…er.ts as the entry point" This reverts commit eb89e79. Backend integration with vite also requires a manifest file & custom implementation for importedChunks which seems more complex at the moment: https://vite.dev/guide/backend-integration
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before
Both the app builder & app renderer were separate Vue app instances using the same index.html file as entry point.
These were the base routes:
app builder →
/studiorenderer →
/studio-appTough to switch routes within the app
During dynamic route addition in the rendered vue app - we had to add the complete routes as
/<app-route>/<page-route>. This made navigation from one page to another hard. Technically only page route should be added to the routerUgly frontend:
Ugly backend:
After
Cleaner app routes
Cleaner page routes
App loads without any prefix
How
StudioAppRendererthat checks if the visited path matches any app route and renders the website generator templateFixes
PS: There are other ways to do this in Vite documentation - https://vite.dev/guide/backend-integration. But that also requires manifest file, implementation of importedChunks and substituting these asset and CSS urls in the html from the backend. The current way is simpler. Will revisit this if needed later on.
One caveat: When I start development, if I make some changes in renderer code, I need atleast 1 build to copy the output to generators. Then the HMR will work fine due to the absolute URL reference to.ts file in dev mode. But nothing changes for people building apps on studio.
Closes #20