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

Improve serve experience #84

Merged
merged 9 commits into from
Nov 18, 2022
Merged

Conversation

jp7677
Copy link
Contributor

@jp7677 jp7677 commented Nov 11, 2022

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.

@jp7677 jp7677 force-pushed the serve-experience branch 6 times, most recently from 4d41127 to 333b505 Compare November 15, 2022 07:27
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 jp7677 force-pushed the serve-experience branch 2 times, most recently from a956b65 to 61542fd Compare November 15, 2022 14:31
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 jp7677 force-pushed the serve-experience branch 3 times, most recently from c3b3ce5 to 0c07b8f Compare November 17, 2022 07:44
@dirkgroot
Copy link
Collaborator

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.
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.

FEATURE: Serve should re-generate website and refresh browser on changes
2 participants