-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Angular build time optimization #4118
Angular build time optimization #4118
Conversation
Please note: I had |
@igor-dv please verify if this is compatible with your preset PR |
I will review it soon (or when I will be bored of doing nothing in a vacation) |
@@ -1,45 +1,55 @@ | |||
import path from '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.
please solve merge conflicts here, it moved to framework-preset-angular
path.resolve(__dirname, '..') | ||
), | ||
new ForkTsCheckerWebpackPlugin({ | ||
tsconfig: tsLoaderOptions.configFile, |
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.
what will happen if there is not a configFile
?
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.
BTW, if tslint
is always located in root, we can also add it here (just check if it exists).
Thanks for your comments! Do you think I should revert + change my approach to fit in into the new template feature? |
I don't think you need to revert. The preset has a similar structure, just move your changes there |
@kroeder, do you need help to finish this? |
Normally I would say "no" but I spent hours trouble shooting why my project does not build, start, tests on master fail.. Even on a fresh checkout :( btw. I am the one asking lots of questions in slack. I'll try to continue today |
# Conflicts: # app/angular/src/server/wrapInitialConfig.js Created a function for ForkTsCheckerWebpackPlugin Added tests for ForkTsCheckerWebpackPlugin
I created a seperate file for creating an instance of ForkTsChecker and added tests for it. |
app/angular/src/server/framework-preset-fork-ts-checker-plugin.js
Outdated
Show resolved
Hide resolved
app/angular/src/server/framework-preset-fork-ts-checker-plugin.js
Outdated
Show resolved
Hide resolved
examples/angular-cli/package.json
Outdated
@@ -9,7 +9,7 @@ | |||
"e2e": "ng e2e", | |||
"ng": "ng", | |||
"start": "ng serve", | |||
"storybook": "npm run storybook:prebuild && start-storybook -p 9008 -s src/assets", | |||
"storybook": "start-storybook -p 9008 -s src/assets", |
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've fixed this, please merge from master and revert this
…ion with @types/jest
Checks are fine now, finally! I just need to integrate the cli stuff as well as the updated documentation for this PR. Anything else you want to add/change? |
Codecov Report
@@ Coverage Diff @@
## master #4118 +/- ##
==========================================
+ Coverage 40.75% 40.78% +0.03%
==========================================
Files 492 493 +1
Lines 5845 5852 +7
Branches 781 782 +1
==========================================
+ Hits 2382 2387 +5
- Misses 3087 3089 +2
Partials 376 376
Continue to review full report at Codecov.
|
I added How can I verify, that |
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.
A few minor comments
We are almost there =)
require('fs').__setMockFiles(files); | ||
}; | ||
|
||
describe('framework-preset-ts-fork-checker-plugin', () => { |
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.
create-fork-ts-checker-plugin.test
@@ -73,6 +73,27 @@ That'll load stories in `../src/stories/index.ts`. | |||
|
|||
Just like that, you can load stories from wherever you want to. | |||
|
|||
## Storybook TypeScript configuration | |||
|
|||
**Note:** You need this only if you are using Storybook `>= 4.0.0-alpha.22`. |
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 think you can mention that this file is created with a Storybok cli (storybook init
that was getstorybook
before)
Also, maybe you can mention that there is a use of ForkTsCheckerWebpackPlugin
to boost the performance.
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 can mention that but the whole guide is more or less a complete "manual installation" guide, isn't it?
https://storybook.js.org/basics/guide-angular/
If you want to set up Storybook manually, this is the guide for you.
Regarding ForkTsCheckerWebpackPlugin
I'll add that.
@Keraito, how are you testing CLI? |
@Keraito I want to check if a custom |
The easiest for now is to probably check this manually for now. Tagging #1108 so I don't forget this.
You can use a smoke test for this. https://github.com/storybooks/storybook/tree/master/lib/cli/test/fixtures Add a example project here without Storybook installed. Running |
I
I don't know if it's related to my PR - anyone knows something about this error? If this is not related to my PR I'm done, so far. 👍 |
I think it's not related 👍 |
Issue: #3968
What I did
Note: This is work-in-progress
loadTsConfig
togetTsLoaderOptions
because that is what it actually does (5801057#diff-aaa47dcc2ee48513f45210bb35a92d4cR1)transpileOnly: true
as default option forts-loader
fork-ts-checker-webpack-plugin
as a dependency inapp/angular
ForkTsChecker
and set optiontsconfig
to the same that is used forts-loader
(usinggetTsLoaderOptions
)Checklist
transpileOnly: true
as defaultts-loader
optionForkTsChecker
to the list of pluginsForkTsChecker
does checkjest
(ERROR in D:/04_Development/ng-projects/storybook/node_modules/@types/jest/index.d.ts(1103,9):
and many more in this file)ts_config.test.js
How to test
Is this testable with Jest or Chromatic screenshots? yes
Does this need a new example in the kitchen sink apps? no
Does this need an update to the documentation? yes
If your answer is yes to any of these, please make sure to include it in your PR.
Manual test:
Start
yarn storybook
inexamples/angular-cli/
Using
ForkTsChecker
adds the folloing message when starting storybookFor maintainers only: Please tag your pull request with at least one of the following:
["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]