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
build(docs-infra): fixed broken stackblitz example of i18n module #42001
build(docs-infra): fixed broken stackblitz example of i18n module #42001
Conversation
2282516
to
6ce58f6
Compare
@petebacondarwin can you help in review this ? Also can you add air-preview label so it can be previewed as well. |
6ce58f6
to
bd1b653
Compare
You can preview 6ce58f6 at https://pr42001-6ce58f6.ngbuilds.io/. |
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.
I thought the fix was to add compiler-cli
into the array here:
angular/aio/tools/stackblitz-builder/builder.js
Lines 49 to 51 in da6ed15
// Add unit test packages from devDependencies for unit test examples | |
const devDependencies = packageJson.devDependencies; | |
['jasmine-core', 'jasmine-marbles'].forEach(dep => exampleDependencies[dep] = devDependencies[dep]); |
Did you try that?
No let me try and update but fyi this is common place so it will add for all files, are you fine with that ? |
@petebacondarwin tried suggestion you provided but it's not working |
The 422 error message helps to solve the mystery:
So we need both |
Yes you want me to import both in builder.js and try, or keep current approach ? |
Rather than include these dependencies in every StackBlitz, I propose that we add a new property to the So for the i18n example we would have: {
"description": "i18n",
"files":[
"!**/*.d.ts",
"!**/*.js",
"!**/*.[0-9].*",
"!doc-files/**/*",
"**/*.xlf"
],
"file": "src/app/app.component.ts",
"tags": ["Angular", "i18n", "internationalization"],
"devDependencies": ["@angular/compiler-cli", "typescript"]
} and then for the testing example we would have: {
"description": "Heroes Test App",
"files":[
"src/index.html",
"src/main.ts",
"src/styles.css",
"src/test.css",
"e2e/src/**/*.ts",
"src/app/**/*.css",
"src/app/**/*.html",
"src/app/**/*.ts",
"!src/**/*.spec.ts"
],
"tags": ["testing"],
"devDependencies": ["jasmine-core", "jasmine-marbles"]
} And then we can remove the hard coded items from |
bd1b653
to
d0fcfd9
Compare
a8a3afe
to
ebc1e1a
Compare
You can preview ebc1e1a at https://pr42001-ebc1e1a.ngbuilds.io/. |
@petebacondarwin it was good suggestion, I have done changes you suggested. can you re-review and also help to rerun test_ivy_aot_win ? |
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.
Thanks for the update. I think it can be a lot simpler.
@@ -100,7 +121,7 @@ class StackblitzBuilder { | |||
try { | |||
const config = this._initConfigAndCollectFileNames(configFileName); | |||
const postData = this._createPostData(config, configFileName); | |||
this._addDependencies(config, postData); | |||
this._addDependencies(config, postData, configFileName); |
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.
No need to add a new parameter here. The config
parameter already contains the devDependencies
that you need.
const testStackblitzestPath = path.join(this.basePath, '/testing/stackblitz.json'); | ||
const stackblitzJsonDevDependencies = this._getDevDependencies(stackBlitzJson); | ||
const stackblitzJsonTestDependencies = this._getDevDependencies(testStackblitzestPath); |
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.
I'm not sure why this code is here, and why it is hard-coded to the /testing/
path.
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.
@petebacondarwin this seems required change because if I remove this it will not import
"jasmine-core", "jasmine-marbles" from test file.
If we don't want to add this line of code then other alternative would be to add
"jasmine-core", "jasmine-marbles" it each and every stackblitz.json
For now I have done changes as you suggested and you can see difference in live example between
https://pr42001-ebc1e1a.ngbuilds.io/guide/i18n
https://pr42001-335a4ca.ngbuilds.io/guide/i18n
ebc1e1a
to
335a4ca
Compare
You can preview 335a4ca at https://pr42001-335a4ca.ngbuilds.io/. |
335a4ca
to
a9cc93e
Compare
a9cc93e
to
b251ee8
Compare
This commit fixes the broken stackblitz example of i18n. Closes angular#41838.
b251ee8
to
7d7abc9
Compare
You can preview 7d7abc9 at https://pr42001-7d7abc9.ngbuilds.io/. |
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.
LGTM! Thanks @iRealNirmal
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit fixes the broken stackblitz example of animation.
Closes 41838.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
angular.io/guide/i18n live example is broken
Issue Number: #41838
What is the new behavior?
angular.io/guide/i18n live example issue if fixed
Does this PR introduce a breaking change?
Other information