Skip to content
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: Fix Angular 15 support and add zone.js v0.14.x support #24367

Merged
merged 15 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -555,27 +555,27 @@ workflows:
requires:
- unit-tests
- create-sandboxes:
parallelism: 20
parallelism: 21
requires:
- build
- build-sandboxes:
parallelism: 20
parallelism: 21
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 17
parallelism: 18
requires:
- build-sandboxes
- e2e-production:
parallelism: 17
parallelism: 18
requires:
- build-sandboxes
- e2e-dev:
parallelism: 4
requires:
- create-sandboxes
- test-runner-production:
parallelism: 17
parallelism: 18
requires:
- build-sandboxes
- bench:
Expand Down Expand Up @@ -609,30 +609,30 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 33
parallelism: 34
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 33
parallelism: 34
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 30
parallelism: 31
requires:
- build-sandboxes
- e2e-production:
parallelism: 30
parallelism: 31
requires:
- build-sandboxes
- e2e-dev:
parallelism: 4
requires:
- create-sandboxes
- test-runner-production:
parallelism: 30
parallelism: 31
requires:
- build-sandboxes
# TODO: reenable once we find out the source of flakyness
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/src/DocsRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ErrorBoundary extends Component<{
const { hasError } = this.state;
const { children } = this.props;

return hasError ? null : children;
return hasError ? null : <>{children}</>;
}
}

Expand Down
10 changes: 9 additions & 1 deletion code/frameworks/angular/src/builders/build-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ export type StorybookBuilderOptions = JsonObject & {
} & Pick<
// makes sure the option exists
CLIOptions,
'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'webpackStatsJson' | 'disableTelemetry'
| 'outputDir'
| 'configDir'
| 'loglevel'
| 'quiet'
| 'webpackStatsJson'
| 'disableTelemetry'
| 'debugWebpack'
>;

export type StorybookBuilderOutput = JsonObject & BuilderOutput & { [key: string]: any };
Expand Down Expand Up @@ -81,6 +87,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (
quiet,
enableProdMode = true,
webpackStatsJson,
debugWebpack,
disableTelemetry,
assets,
} = options;
Expand All @@ -103,6 +110,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (
},
tsConfig,
webpackStatsJson,
debugWebpack,
};

return standaloneOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"description": "Controls level of logging during build. Can be one of: [silly, verbose, info (default), warn, error, silent].",
"pattern": "(silly|verbose|info|warn|silent)"
},
"debugWebpack": {
"type": "boolean",
"description": "Debug the Webpack configuration",
"default": false
},
"enableProdMode": {
"type": "boolean",
"description": "Disable Angular's development mode, which turns off assertions and other checks within the framework.",
Expand Down
3 changes: 3 additions & 0 deletions code/frameworks/angular/src/builders/start-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type StorybookBuilderOptions = JsonObject & {
| 'initialPath'
| 'open'
| 'docs'
| 'debugWebpack'
>;

export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
Expand Down Expand Up @@ -103,6 +104,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (options, cont
assets,
initialPath,
open,
debugWebpack,
} = options;

const standaloneOptions: StandaloneOptions = {
Expand Down Expand Up @@ -130,6 +132,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (options, cont
tsConfig,
initialPath,
open,
debugWebpack,
};

return standaloneOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
"default": null
},
"debugWebpack": {
"type": "boolean",
"description": "Debug the Webpack configuration",
"default": false
},
"tsConfig": {
"type": "string",
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/src/client/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { global } from '@storybook/global';
/** *************************************************************************************************
* Zone JS is required by Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/** *************************************************************************************************
* APPLICATION IMPORTS
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ export const merged: TemplateKey[] = [
...normal,
'react-webpack/18-ts',
'react-webpack/17-ts',
// 'angular-cli/15-ts', // TODO: re-enable when building the storybook works again
'angular-cli/15-ts',
'preact-webpack5/default-ts',
'preact-vite/default-ts',
'html-webpack/default',
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"chalk": "^4.1.0",
"esbuild": "^0.18.0",
"esbuild-register": "^3.5.0",
"file-system-cache": "^2.4.4",
"file-system-cache": "2.3.0",
"find-cache-dir": "^3.0.0",
"find-up": "^5.0.0",
"fs-extra": "^11.1.0",
Expand Down
2 changes: 1 addition & 1 deletion code/lib/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@storybook/channels": "workspace:*",
"@types/babel__core": "^7.0.0",
"@types/express": "^4.7.0",
"file-system-cache": "^2.4.4"
"file-system-cache": "2.3.0"
},
"devDependencies": {
"@storybook/csf": "^0.1.0",
Expand Down
Loading