[widgets] Support serving a basic widget manifest in vite serve mode #1022
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 augments the widget vite plugin to serve a basic form of the manifest so that we can trigger a localhost-driven developer mode against a Foundry environment. The workflow would look like the following:
FOUNDRY_TOKEN
in your terminalfoundry.config.json
is setdev
Some considerations for this (incomplete) version:
.config
file and parse it on the fly instead, if that's not too expensive?./palantir/setup
, which will receive the list of HTML entrypoint files and then load them in invisible iframes. The loading of these HTML files triggers the vite plugin code which goes and logs all the JS entrypoint files, which we then use to compose a manifest file. The tiny app then sits there and polls for the manifest until it sees an entrypoint file for every manifest, and then it tells the plugin to send the manifest to Foundry. If successful, it will redirect the dev to Foundry to see their widget in the preview harness