-
Notifications
You must be signed in to change notification settings - Fork 36
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
Improve serve experience #84
Merged
Merged
Conversation
This file contains 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
jp7677
force-pushed
the
serve-experience
branch
6 times, most recently
from
November 15, 2022 07:27
4d41127
to
333b505
Compare
No need to hardcode this in code once you know how to set this property in the dsl file. This is a left-over from avisi-cloud#79
You don't have to define software systems for a valid DSL file.
jp7677
force-pushed
the
serve-experience
branch
2 times, most recently
from
November 15, 2022 14:31
a956b65
to
61542fd
Compare
jp7677
commented
Nov 15, 2022
jp7677
commented
Nov 15, 2022
src/main/kotlin/nl/avisi/structurizr/site/generatr/CreateStructurizrWorkspace.kt
Outdated
Show resolved
Hide resolved
Those hash files identify the content and won't change after re-generation when the content hasn't changed. We do clean up no longer relevant hash files though. Also ignore hash files from the file watcher.
This gives e.g. Intelli time to clean up any temporary files and thus won't trigger anymore two site generations with one save-action in the editor.
jp7677
force-pushed
the
serve-experience
branch
3 times, most recently
from
November 17, 2022 07:44
c3b3ce5
to
0c07b8f
Compare
dirkgroot
requested changes
Nov 18, 2022
src/main/kotlin/nl/avisi/structurizr/site/generatr/site/SiteGenerator.kt
Show resolved
Hide resolved
src/main/kotlin/nl/avisi/structurizr/site/generatr/site/SiteGenerator.kt
Outdated
Show resolved
Hide resolved
Thanks! I've tested it, and it works really well. It makes the "developer experience" a lot better, when working on a model! |
Include a simple auto-reload script that frequently reads the hash files. Reload the current page when content has changed. Redirect to the home page when a has file is no longer available, thus e.g. an error has occured while loading or parsing the DSL file or when a software system has been renamed. Inject the auto-reload script only when "serving" the generated a web site but not when "generating" only.
This remove the polling delay and is overall a much nicer solution. Add `websocket-jetty-server` dependency for web socket support for the server. Also catch site generation exceptions and send the error using web sockets.
jp7677
force-pushed
the
serve-experience
branch
from
November 18, 2022 08:35
0c07b8f
to
afefc07
Compare
dirkgroot
approved these changes
Nov 18, 2022
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.
This PR improves the serving experience with
This should make editing and viewing DSL sites much more pleasant, no need anymore to keep an eye on the console for any errors and also no need anymore for manual refreshes.
Note that the polling in the browser is not the most elegant way, but it is simple and straight forward. Doing something with e.g. web-sockets could be a thing for later.Switching to web sockets turned out to be easier than I thought, so web sockets are used to send a signal to browsers.This PR is based on #80 , so reviewing the other PR first makes sense.