-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
refactor: remove app boilerplate and improvements to cx protocol #868
Merged
Commits on Oct 8, 2018
-
refactor: improvements to cx protocol
Change the cx protocol to use environment variables and file output instead of argv/stdout. This simplifies the App boilerplate code. Now, apps look like this: const app = new App(); // add stacks app.run(); The protocol was also simplified to basically always synthesize all stacks in the app, eliminating the need for a "cx request" altogether. The toolkit was modified to cache the response of the first successful execution of the app (after environment contextual is resolved). This reduces the number of app executions to a maximum of 2 (if env context is missing) and normally 1. Previoiusly, "list" and "synth" were two separate commands, so 2 was the normal case. The protocol now uses the following environment variables: * `CDK_OUTDIR` represents the synthesis output directory. The toolkit allocates a temporary working directory when it executes the app and sets this variable. * `CDK_CONTEXT_JSON` is a JSON stringified context object. At the moment, if `CDK_OUTDIR` is not defined, an error message is printed indicating the minimum version of the toolkit required to interact with the app. Fixes #216 BREAKING CHANGE This is a major breaking change: - The `cdk.App` initializer doesn't accept any arguments. - The `cdk.App#run` method does not return a `string` anymore. All AWS CDK apps in all languages would need to be modified to adhere to the new API of the `cdk.App` construct. Instead of: const app = new App(process.argv); // ERROR // add stacks process.stdout.write(app.run()); // ERROR The new usage is: const app = new App(); // add stacks app.run(); In order to interact with applications written using this version, the CDK Toolkit must also be update using: $ npm i -g aws-cdk
Elad Ben-Israel committedOct 8, 2018 Configuration menu - View commit details
-
Copy full SHA for d9fb15e - Browse repository at this point
Copy the full SHA d9fb15eView commit details -
Elad Ben-Israel committed
Oct 8, 2018 Configuration menu - View commit details
-
Copy full SHA for bd5da91 - Browse repository at this point
Copy the full SHA bd5da91View commit details -
Fix a couple more integration tests
Elad Ben-Israel committedOct 8, 2018 Configuration menu - View commit details
-
Copy full SHA for f36f458 - Browse repository at this point
Copy the full SHA f36f458View commit details -
Elad Ben-Israel committed
Oct 8, 2018 Configuration menu - View commit details
-
Copy full SHA for 6296289 - Browse repository at this point
Copy the full SHA 6296289View commit details -
Elad Ben-Israel committed
Oct 8, 2018 Configuration menu - View commit details
-
Copy full SHA for 909fcae - Browse repository at this point
Copy the full SHA 909fcaeView commit details -
Elad Ben-Israel committed
Oct 8, 2018 Configuration menu - View commit details
-
Copy full SHA for a504d6f - Browse repository at this point
Copy the full SHA a504d6fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 698d3e0 - Browse repository at this point
Copy the full SHA 698d3e0View commit details -
Merge remote-tracking branch 'origin/master' into beinsrae/remove-app…
…-boilerplate
Elad Ben-Israel committedOct 8, 2018 Configuration menu - View commit details
-
Copy full SHA for 6e42782 - Browse repository at this point
Copy the full SHA 6e42782View commit details -
Merge remote-tracking branch 'origin/master' into beinsrae/remove-app…
…-boilerplate
Elad Ben-Israel committedOct 8, 2018 Configuration menu - View commit details
-
Copy full SHA for cd5d9fa - Browse repository at this point
Copy the full SHA cd5d9faView commit details
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.