enhancement: Added warm
feature to all SsrSite
constructs
#2996
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.
Bug Fix
There is a TypeScript issue when running
pnpm build
where the value returned onpackages/sst/src/stacks/build.ts:66
frombabel.parse
can be eitherconst ast: ParseResult<babel.types.File> | null
. This is an issue as the next commandbabel.traverse
can only accept the typeNode
- andnull
does not fit this interface.After having a look into
@babel/core
it would appear that this value would only be null in the instance that there is not a config defined for babel:fn
. If we go back toparse
we can see thisfn
is equal to eitherparseRunner.sync
orparseRunner.errback
.parseRunner
if config is null we return null.In practice this should never happen as
loadConfig
should throw an error if there is a file with no configuration, but for our purposes this will basically just fix the type error by checking fornull
.Enhancement: SsrSite
warm
Featurewarmer-function
which is compiled by SST and warms regionally deployed lambdas forSsrSite
build.mjs
to build thewarmer-function
when SST is built, that way there is no dependence upon the consumers of theSsrSite
viaRemixSite
,NextjsSite
, (and all others) to implement the function themselves.warm
andcreateWarmer
pieces of theNextjsSite
as this now happens more generally for allSsrSite
SsrSite
to implement thewarm
andcreateWarmer