-
Notifications
You must be signed in to change notification settings - Fork 590
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
feat: add pluggable runtime specific config #404
feat: add pluggable runtime specific config #404
Conversation
This comment has been minimized.
This comment has been minimized.
@@ -0,0 +1,30 @@ | |||
import { invalidFunction } from '@aws-sdk/invalid-dependency'; |
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.
Prettier wasn't run on this file.
Please cut a separate issue for tracking if git hooks aren't working
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.
How do you know it?
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.
Single quotes 😉
If this is an issue with git-hooks, it can be tracked in a separate issue
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.
It turns out my local workspace's formatter did set to vscode default ones. So I added a vscode.settings: "editor.defaultFormatter": "esbenp.prettier-vscode"
Codecov Report
@@ Coverage Diff @@
## smithy-codegen #404 +/- ##
==================================================
+ Coverage 96.72% 96.74% +0.02%
==================================================
Files 69 70 +1
Lines 1161 1169 +8
Branches 214 214
==================================================
+ Hits 1123 1131 +8
Misses 38 38
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
* export runtimeConfig.runtime.ts to manually set the client to be compatible with specific runtime * get rid of rollup, instead using browser property to swap runtime config * add endpoint to the serializer utilities and insert it when building a request
4387c11
to
a7b4ef8
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Add runtime specific config
runtimeConfig.ts
andruntimeConfig.browser.ts
. I use browser property to swap the config according to build target. This nice thing of it is that when bundler cannot correctly bundle the client, users can supply theconst
from theruntimeConfig
to the client the client will be target at right runtime. So no rollup pre-bundling is needed.Fix the exerializer to take endpoint from resolved client config
Rename
HttpEndpoint
toEndpoint
in@aws-sdk/types
because it is suppose to be non http specific/cc @srchase Do merge it with your future PR and feel free to close it.
Also please renameAWSClientRuntimeConfiguration
toRDSDataRuntimeConfiguration
Note: I managed to make it work in browser although RDS-Data doesn't support CORS. So this PR contains some small bug fixing. My local webpack production bundle with 1 command takes 61 KB whereas the released version
@aws-sdk/client-rds-data-browser
takes 76KB. I assume that's because of the optimization from ESModule and side-effect configBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.