-
Notifications
You must be signed in to change notification settings - Fork 316
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
assets: embedded asset server #5622
Conversation
8fd0236
to
23286bf
Compare
Remove precompiled server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yessssssssss!!!!
pkg/assets/embedded.go
Outdated
http.Handler | ||
} | ||
|
||
func NewEmbeddedServer() (Server, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the more idiomatic API is something like:
GetEmbeddedServer() (Server, bool)
since "the server doesn't exist" isn't something that you're treating as an error. here's an example of an API that does this: https://pkg.go.dev/os#LookupEnv
8c30625
to
d0588e1
Compare
d0588e1
to
ef64b94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
During release builds, copy js assets to pkg/assets/build for embedding in the Tilt executable using go:embed. When in
--web-mode=prod
, prefer embedded asset server to prod asset server if embedded assets are available, identified by index.html being present.Also,
PrecompiledWebMode
is replaced by this embedded server as well, since both run from the result ofmake build-js
.