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

Create a new pull request by comparing changes across two branches #926

Merged
merged 53 commits into from
Sep 18, 2024

Commits on Sep 5, 2024

  1. perf(@angular/cli): enable Node.js compile code cache when available

    The Angular CLI will now enable the Node.js compile cache when available
    for use. Node.js v22.8 and higher currently provide support for this feature.
    The compile cache stores the v8 intermediate forms of JavaScript code for the Angular
    CLI itself. This provides a speed up to initialization on subsequent uses the Angular CLI.
    The Node.js cache is stored in a temporary directory in a globally accessible
    location so that all Node.js instances of a compatible version can share the
    cache. The code cache can be disabled if preferred via `NODE_DISABLE_COMPILE_CACHE=1`.
    
    Based on initial profiling, this change provides an ~6% production build time
    improvement for a newly generated project once the cache is available.
    
    ```
    Benchmark 1: NODE_DISABLE_COMPILE_CACHE=1 node ./node_modules/.bin/ng build
      Time (mean ± σ):      2.617 s ±  0.016 s    [User: 3.795 s, System: 1.284 s]
      Range (min … max):    2.597 s …  2.640 s    10 runs
    
    Benchmark 2: node ./node_modules/.bin/ng build
      Time (mean ± σ):      2.475 s ±  0.017 s    [User: 3.555 s, System: 1.354 s]
      Range (min … max):    2.454 s …  2.510 s    10 runs
    
    Summary
      node ./node_modules/.bin/ng build ran
        1.06 ± 0.01 times faster than NODE_DISABLE_COMPILE_CACHE=1 node ./node_modules/.bin/ng build
    ```
    clydin committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    ecc107d View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2024

  1. feat(@angular/ssr): introduce AngularNodeAppEngine API for Node.js …

    …integration
    
    Expose a variant of `AngularAppEngine` tailored for Node.js. These additions streamline the process by minimizing boilerplate code and eliminate the need for users to call `createWebRequestFromNodeRequest` before invoking the render method.
    alan-agius4 committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    576ff60 View commit details
    Browse the repository at this point in the history
  2. feat(@angular/ssr): Add getHeaders Method to AngularAppEngine and…

    … `AngularNodeAppEngine` for handling pages static headers
    
    This commit introduces a new `getHeaders` method to the `AngularAppEngine` and `AngularNodeAppEngine` classes, designed to facilitate the retrieval of HTTP headers based on URL pathnames for statically generated (SSG) pages.
    
    ```typescript
    const angularAppEngine = new AngularNodeAppEngine();
    
    app.use(express.static('dist/browser', {
      setHeaders: (res, path) => {
        // Retrieve headers for the current request
        const headers = angularAppEngine.getHeaders(res.req);
    
        // Apply the retrieved headers to the response
        for (const { key, value } of headers) {
          res.setHeader(key, value);
        }
      }
    }));
    ```
    
    In this example, the `getHeaders` method is used within an Express application to dynamically set HTTP headers for static files. This ensures that appropriate headers are applied based on the specific request, enhancing the handling of SSG pages.
    alan-agius4 committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    41fb2ed View commit details
    Browse the repository at this point in the history
  3. refactor(@angular/ssr): remove singleton helpers

    This commit removes the singleton helpers and instead exposes the
    classes directly.
    alan-agius4 committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    7d9ce24 View commit details
    Browse the repository at this point in the history
  4. fix(@angular/ssr): resolve circular dependency issue from main.server…

    ….js reference in manifest
    
    The issue was addressed by changing the top-level import to a dynamic import.
    
    Closes #28358
    alan-agius4 committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    e9c9e49 View commit details
    Browse the repository at this point in the history
  5. build: update dependency ini to v5

    angular-robot authored and clydin committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    63d4f92 View commit details
    Browse the repository at this point in the history
  6. build: update angular

    angular-robot authored and clydin committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    d87822c View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2024

  1. Configuration menu
    Copy the full SHA
    eb97c43 View commit details
    Browse the repository at this point in the history
  2. docs: elaborate on debugging jasmine node tests

    The existing instructions don't quite cover a full debugging setup
    and miss some flags that allow debugging without modification of
    BUILD files.
    jkrems authored and alan-agius4 committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    f8b2203 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    201b60e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e4d598f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    27c1c77 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. build: lock file maintenance

    angular-robot authored and alan-agius4 committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    724cd41 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7981dd2 View commit details
    Browse the repository at this point in the history
  3. build: update all remaining places to TypeScript 5.6

    Updates a few leftover places to the TypeScript 5.6 final version.
    crisbeto authored and alan-agius4 committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    8f051a4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    26c6d2d View commit details
    Browse the repository at this point in the history
  5. refactor(@angular/build): add explicit type annotations to avoid infe…

    …rred types
    
    This refactor resolves an issue where the inferred type of `renderSassStylesheet` required an external reference, which could affect portability.
    
    Fixes the following error:
    ```
    packages/angular/build/src/tools/sass/worker.ts:59:31 - error TS2742: The inferred type of 'renderSassStylesheet' cannot be named without a reference to '../../../../../../external/npm/node_modules/source-map-js/source-map'. This is likely not portable. A type annotation is necessary.
    ```
    Explicit type annotation added to `renderSassStylesheet` function to prevent reliance on inferred types.
    
    **Note:** Ensure compatibility with Windows Bazel builds.
    alan-agius4 committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    6c6248e View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2024

  1. refactor: Add lines-around-comment rule

    I often struggle with spacing around block comments, so I've decided to add the `lines-around-comment` lint rule to help manage this.
    
    For more details, see the https://eslint.style/rules/js/lines-around-comment
    alan-agius4 committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    743188b View commit details
    Browse the repository at this point in the history
  2. fix(@angular/build): prevent transformation of Node.js internal depen…

    …dencies by Vite
    
    This commit excludes Node.js module imports from being processed by Vite when prebundling is enabled.
    
    Closes #28390
    alan-agius4 committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    4153a6e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    99ee012 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    af6e200 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. feat(@angular-devkit/architect): merge object options from CLI

    We recently introduced the ability to pass object values from the
    command line (#28362). @clydin noticed that the initial behavior
    didn't work well for `--define`: It completely replaced all values
    even if just one of multiple defines is specified.
    
    This updates the architect to support merging of object options.
    If both the base option (e.g. from `angular.json`) and the override
    (e.g. from a CLI `--flag`) are objects, the objects are merged.
    
    See: #28362
    jkrems authored and alan-agius4 committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    78f7648 View commit details
    Browse the repository at this point in the history
  2. build: update angular

    angular-robot authored and alan-agius4 committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    52f4aa1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5bba61d View commit details
    Browse the repository at this point in the history
  4. refactor(@angular/build): support dev server direct component style s…

    …erving
    
    The Vite-based development server now provides support for serving individual
    component stylesheets both with and without emulated view encapsulation. This
    capability is not yet used by the Angular runtime code. The ability to use
    external stylesheets instead of bundling the style content is an enabling
    capability primarily for automatic component style HMR features. Additionally,
    it has potential future benefits for development mode deferred style processing
    which may reduce the initial build time when using the development server. The
    application build itself also does not yet generate external stylesheets.
    clydin authored and alan-agius4 committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    434979a View commit details
    Browse the repository at this point in the history
  5. refactor(@angular/cli): remove unused imports

    Remove unused imports from command-module file.
    alan-agius4 committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    929d483 View commit details
    Browse the repository at this point in the history
  6. refactor(@angular/ssr): use ReadonlyMap instead of Readonly mappe…

    …d type
    
    The `Readonly` mapped type only introduces the `readonly` modifier for each property,
    but `Map` has mutating methods like `clear`, `delete` and `set` that would still
    remain usable. This commit switches those usages over to the `ReadonlyMap` type which
    doesn't have any of the mutating methods.
    JoostK authored and alan-agius4 committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    056d17a View commit details
    Browse the repository at this point in the history
  7. fix(@angular/ssr): resolve bootstrap is not a function error

    In cases where the application is not zoneless and async/await is downleveled, an issue occurred where `await` was not being downleveled correctly. This led to the `bootstrap is not a function` error.
    
    See: https://github.com/angular/angular/actions/runs/10817795242/job/30014914340?pr=57776
    alan-agius4 committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    85df401 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    793f6a0 View commit details
    Browse the repository at this point in the history
  9. feat(@angular/ssr): add server routing configuration API

    This commit introduces a new server routing configuration API, as discussed in RFC angular/angular#56785. The new API provides several enhancements:
    
    ```ts
    const serverRoutes: ServerRoute[] = [
      {
        path: '/error',
        renderMode: RenderMode.Server,
        status: 404,
        headers: {
          'Cache-Control': 'no-cache'
        }
      }
    ];
    ```
    
    ```ts
    const serverRoutes: ServerRoute[] = [
      {
        path: '/product/:id',
        renderMode: RenderMode.Prerender,
        async getPrerenderPaths() {
          const dataService = inject(ProductService);
          const ids = await dataService.getIds(); // Assuming this returns ['1', '2', '3']
          return ids.map(id => ({ id })); // Generates paths like: [{ id: '1' }, { id: '2' }, { id: '3' }]
        }
      }
    ];
    ```
    
    ```ts
    const serverRoutes: ServerRoute[] = [
      {
        path: '/product/:id',
        renderMode: RenderMode.Prerender,
        fallback: PrerenderFallback.Server, // Can be Server, Client, or None
        async getPrerenderPaths() {
        }
      }
    ];
    ```
    
    ```ts
    const serverRoutes: ServerRoute[] = [
      {
        path: '/product/:id',
        renderMode: RenderMode.Server,
      },
      {
        path: '/error',
        renderMode: RenderMode.Client,
      },
      {
        path: '/**',
        renderMode: RenderMode.Prerender,
      },
    ];
    ```
    
    These additions aim to provide greater flexibility and control over server-side rendering configurations and prerendering behaviors.
    alan-agius4 committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    d66aaa3 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. Configuration menu
    Copy the full SHA
    ac71ce1 View commit details
    Browse the repository at this point in the history
  2. Revert "perf(@angular/cli): enable Node.js compile code cache when av…

    …ailable"
    
    This reverts commit ecc107d.
    alan-agius4 committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    de17cbc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    62b2c6c View commit details
    Browse the repository at this point in the history
  4. refactor(@angular/build): implement custom middleware for header appe…

    …nding
    
    Replaced multiple `appendServerConfiguredHeaders` calls with a single custom middleware to append headers to all responses, simplifying the code and ensuring consistency.
    alan-agius4 committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    740c648 View commit details
    Browse the repository at this point in the history
  5. refactor(@angular/build): assign name to custom Vite middleware for b…

    …etter debugging
    
    Naming the custom middleware improves the ability to identify middleware order during debugging.
    alan-agius4 committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    902dbf3 View commit details
    Browse the repository at this point in the history
  6. build: update angular

    angular-robot authored and alan-agius4 committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    89e6d2c View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. Configuration menu
    Copy the full SHA
    c9324e7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    93542bf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d60f3fe View commit details
    Browse the repository at this point in the history
  4. fix(@angular/ssr): correct route extraction and error handling

    This commit introduces the following changes:
    - Disallows paths starting with a slash to match Angular router behavior.
    - Errors are now stored and displayed at a later stage, improving UX by avoiding unnecessary stack traces that are not useful in this context.
    alan-agius4 committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    2640bf7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5d6f1db View commit details
    Browse the repository at this point in the history
  6. build: update angular

    angular-robot authored and jkrems committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    fecb00e View commit details
    Browse the repository at this point in the history
  7. build: lock file maintenance

    angular-robot authored and jkrems committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    09d2eb9 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2024

  1. feat(@angular/ssr): add isMainModule function

    Adds a new function `isMainModule` that checks if the current module is the main entry point of the application.
    
    This is useful to ensure that server listener handlers are only registered when the module is executed directly and not when it's imported as a dependency such as the dev-server. This prevents potential issues with multiple listeners being registered unintentionally.
    alan-agius4 committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    f346ee8 View commit details
    Browse the repository at this point in the history
  2. refactor(@angular/ssr): add option to exclude fallback SSG routes fro…

    …m extraction
    
    This option allows validation during the build process to ensure that, when the output mode is set to static, no routes requiring server-side rendering are included.
    alan-agius4 committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    ea4b99b View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2024

  1. perf(@angular/cli): enable Node.js compile code cache when available

    The Angular CLI will now enable the Node.js compile cache when available
    for use. Node.js v22.8 and higher currently provide support for this feature.
    The compile cache stores the v8 intermediate forms of JavaScript code for the Angular
    CLI itself. This provides a speed up to initialization on subsequent uses the Angular CLI.
    The Node.js cache is stored in a temporary directory in a globally accessible
    location so that all Node.js instances of a compatible version can share the
    cache. The code cache can be disabled if preferred via `NODE_DISABLE_COMPILE_CACHE=1`.
    
    Based on initial profiling, this change provides an ~6% production build time
    improvement for a newly generated project once the cache is available.
    
    ```
    Benchmark 1: NODE_DISABLE_COMPILE_CACHE=1 node ./node_modules/.bin/ng build
      Time (mean ± σ):      2.617 s ±  0.016 s    [User: 3.795 s, System: 1.284 s]
      Range (min … max):    2.597 s …  2.640 s    10 runs
    
    Benchmark 2: node ./node_modules/.bin/ng build
      Time (mean ± σ):      2.475 s ±  0.017 s    [User: 3.555 s, System: 1.354 s]
      Range (min … max):    2.454 s …  2.510 s    10 runs
    
    Summary
      node ./node_modules/.bin/ng build ran
        1.06 ± 0.01 times faster than NODE_DISABLE_COMPILE_CACHE=1 node ./node_modules/.bin/ng build
    ```
    clydin committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    f249e7e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    33e6cb0 View commit details
    Browse the repository at this point in the history
  3. fix(@angular/build): support HTTP HEAD requests for virtual output files

    When using the development server, HTTP HEAD requests will now correctly
    respond for the virtual output files generated from the Angular build
    system.  Previously Vite only handled GET requests for the files. While
    HEAD requests are not common in development workflows, it can be needed in
    more complex cases with additional servers/proxies/etc. during development.
    clydin committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    f6b7cd9 View commit details
    Browse the repository at this point in the history
  4. refactor(@angular-devkit/core): fix up internal typings

    Resolves some type errors that showed up internally.
    crisbeto authored and jkrems committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    a3bbe0e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bd782db View commit details
    Browse the repository at this point in the history
  6. build: update angular

    angular-robot authored and jkrems committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    8c9bf69 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3d10fa1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ed2aecf View commit details
    Browse the repository at this point in the history