feat(loader): add S3 fast-path cache probe to versioned loader endpoint#161
feat(loader): add S3 fast-path cache probe to versioned loader endpoint#161jameswillis99 wants to merge 1 commit intoplasmicapp:masterfrom
Conversation
Probe S3 for a pre-built bundle before resolving project dependencies or doing any DB work. On a warm cache hit the full codegen and dep-resolution pipeline is skipped entirely. - Add tryGetS3CacheEntry<T> to s3-util: read-only probe returning T|null - Add getS3Client singleton to avoid re-instantiating S3 on every call - Extract makeExportOpts helper in gen-code-bundle to deduplicate export opts construction shared between fast-path key and full path - Add tryGetCachedPublishedBundle fast-path at top of genPublishedLoaderCodeBundle - Add _testonly.resetS3Client for test isolation - Add s3-util.spec.ts with 8 tests covering hit/miss/timeout/singleton reset - Add makeExportOpts tests to gen-code-bundle.spec.ts
|
@jwillis24 is attempting to deploy a commit to the Plasmic Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for your submission, we really appreciate it! ❤️ Like many open-source projects, we ask that you sign our Individual Contributor License Agreement before we can accept your contribution. If you are contributing on behalf of a company, please contact us at help@plasmic.app to sign a Corporate Contributor License Agreement. You can sign the individual CLA by posting a comment with the below text. I have read, agree to, and hereby sign Plasmic's Individual Contributor License Agreement You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
Hey James, thanks for the contribution! We'll be merging this in soon. Do you mind accepting the CLA? |
|
Thank you @jaslong ! As I'm contributing on behalf of a company it's currently in the hands of our legal department, I'm hoping this shouldn't take too long. |
Summary
Probes S3 for a pre-built bundle before resolving project dependencies or doing any DB work. On a warm cache hit the full codegen and dep-resolution pipeline is skipped entirely, significantly reducing latency for versioned loader requests.
tryGetS3CacheEntry<T>tos3-util— read-only probe returningT | null, never computes or storesgetS3Client()singleton to avoid re-instantiating the S3 client on every cache callmakeExportOptshelper ingen-code-bundleto deduplicate export opts construction shared between the fast-path key and the full pathtryGetCachedPublishedBundlefast-path at the top ofgenPublishedLoaderCodeBundle_testonly.resetS3Clientfor test isolationTest plan
s3-util.spec.ts— 8 new tests covering cache hit, cache miss, TimeoutError rethrow, singleton reset (all passing)gen-code-bundle.spec.ts— 5 new tests formakeExportOptscovering version flags, i18n, and defaults consistency (requiresyarn gen:modelsto run)/api/v1/loader/code/versionedwith a warm S3 cache and confirm response is served without DB round-trips