Allow string entrypoints, add debug flag, and improve support for Docker#2031
Merged
jwoertink merged 9 commits intoluckyframework:mainfrom Apr 4, 2026
Merged
Conversation
jwoertink
reviewed
Apr 4, 2026
Comment on lines
+38
to
+40
| def self.from_json(pull : JSON::PullParser) : Array(String) | ||
| case pull.kind | ||
| when .string? then [pull.read_string] |
Member
There was a problem hiding this comment.
Clever. I was originally thinking it should have been an exception, but I think this actually fits better with the whole "action of least surprise" or whatever that saying is. I originally reached for a string without thinking 😅 so this works great!
Contributor
Author
There was a problem hiding this comment.
Yeah, I figured you wouldn't be the first. I would probably walk into that as well at some point😊
jwoertink
approved these changes
Apr 4, 2026
Member
jwoertink
left a comment
There was a problem hiding this comment.
Good catch on that Docker connection issue. These fixes definitely help polish this up.
Contributor
Author
|
Your input was golden here. It pushed me down another rabbit hole of things that could go wrong, as you can see from the commits. 😬 |
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
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.
Purpose
listenHostoption)--debugflag to show WebSocket client connect messages in logs (discussed in Bun Client disconnected/connected on 404s? #2027)watchDirsconfig optionDescription
Eternal reload loop
If the WS server wasn't available, it triggered
onclosewhich did a reconnect, resulting in an eternal reconnect loop. It's now fixed by registering a successful connection first, and only attempting a reconnect if that flag was set totrue.Better support for docker development
Inside Docker Bun will need to listen to
0.0.0.0. That can now be done by using thelistenHostoption:{ "devServer": { "listenHost": "0.0.0.0" } }If no
listenHostis defined, thehostoption will be used instead, which defaults to127.0.0.1String entry points
Bun treated the strings as arrays, so every character in the entrypoint string was considered to be an entry point. Now both arrays and strings are supported because it's an easy mistake to make.
The
--debugflagWebSocket client connection status logs are now behind the
--debugflag. So you'll have now:bun bake.js→ builds assets without fingerprinting and minificationbun bake.js --dev→ builds assets without fingerprinting and minification, and starts dev serverbun bake.js --dev --debug→ dev server with WS connection infobun bake.js --prod→ builds assets with fingerprinting and minificationbun bake.js --dev --prod→ dev server, but with fingerprinting and minification (a.k.a. production build in development)The
watchDirsconfig optionIn the
bun_bun_bundleRuby gem we watch onapp/assets, which naturally excludes all other files. On the Lucky side, we watched onsrc, including all Crystal files as well. Since assets in Lucky are not scoped to one directory, those individual directories needed to be configured.We could have derived the watch dirs from the
staticDirs+ directory names of theentryPoints, but that's not watertight. Because what if someone configures entrypoints to be atsrc/js/entrypoints/app.js? Then none of the other JS files would be included. The currentwatchDirsconfig option sets good defaults for Lucky:src/jssrc/csssrc/imagessrc/fontsI think it's safe to assume that for 95% of the projects this config option won't need to be touched.
Checklist
crystal tool format spec src./script/setup./script/test