Skip to content

Commit

Permalink
Merge branch 'beta' into vitest-application-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Dec 2, 2024
2 parents db57805 + fec5bbc commit 9c8ce4a
Show file tree
Hide file tree
Showing 119 changed files with 2,732 additions and 2,108 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,15 @@
"contributions": [
"doc"
]
},
{
"login": "nickytonline",
"name": "Nick Taylor",
"avatar_url": "https://avatars.githubusercontent.com/u/833231?v=4",
"profile": "https://nickyt.co",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
# [1.10.0-beta.6](https://github.com/analogjs/analog/compare/v1.10.0-beta.5...v1.10.0-beta.6) (2024-11-26)

### Bug Fixes

- **platform:** exclude Nx Module Federation package from optimization ([#1460](https://github.com/analogjs/analog/issues/1460)) ([b767a79](https://github.com/analogjs/analog/commit/b767a79efac843f9d657933eccf8cc63a82fe775))

# [1.10.0-beta.5](https://github.com/analogjs/analog/compare/v1.10.0-beta.4...v1.10.0-beta.5) (2024-11-21)

### Bug Fixes

- **router:** support transfer state/prerendering for static assets ([#1453](https://github.com/analogjs/analog/issues/1453)) ([3ad2dec](https://github.com/analogjs/analog/commit/3ad2dec2267d8c644737e2ea11580cbcd21dcab9))

# [1.10.0-beta.4](https://github.com/analogjs/analog/compare/v1.10.0-beta.3...v1.10.0-beta.4) (2024-11-20)

### Features

- **nx-plugin:** add template for Angular v19 ([#1451](https://github.com/analogjs/analog/issues/1451)) ([cdff236](https://github.com/analogjs/analog/commit/cdff23662c9b88b342b00c34faa74d285a7be200))

# [1.10.0-beta.3](https://github.com/analogjs/analog/compare/v1.10.0-beta.2...v1.10.0-beta.3) (2024-11-19)

### Features

- **vite-plugin-nitro:** update Nitro to 2.10.x and add default compatibility date ([#1450](https://github.com/analogjs/analog/issues/1450)) ([5e75b50](https://github.com/analogjs/analog/commit/5e75b507e51364ef1d3619eb5ef74db955bca3ed))

# [1.10.0-beta.2](https://github.com/analogjs/analog/compare/v1.10.0-beta.1...v1.10.0-beta.2) (2024-11-19)

### Bug Fixes

- **router:** make withExtraRoutes function public ([#1446](https://github.com/analogjs/analog/issues/1446)) ([2008bd8](https://github.com/analogjs/analog/commit/2008bd8059be1f5d1e177078591a17e37f681b33))

# [1.10.0-beta.1](https://github.com/analogjs/analog/compare/v1.9.5-beta.1...v1.10.0-beta.1) (2024-11-19)

### Features

- **create-analog:** update template for latest to Angular v19 ([#1447](https://github.com/analogjs/analog/issues/1447)) ([72b8dc7](https://github.com/analogjs/analog/commit/72b8dc79b2cd28ad66c3a297d1725a4e51974693))

## [1.9.5-beta.1](https://github.com/analogjs/analog/compare/v1.9.4...v1.9.5-beta.1) (2024-11-19)

### Performance Improvements

- **vite-plugin-angular:** speed up tests by reusing compiler ([#1444](https://github.com/analogjs/analog/issues/1444)) ([a7f4587](https://github.com/analogjs/analog/commit/a7f4587ef2047ce7c623046b650037a77465f9e2))

## [1.9.4](https://github.com/analogjs/analog/compare/v1.9.3...v1.9.4) (2024-11-18)

### Bug Fixes

- **vite-plugin-angular:** improve support for Angular Material and testing using harnesses ([#1442](https://github.com/analogjs/analog/issues/1442)) ([8338d42](https://github.com/analogjs/analog/commit/8338d4209f1cd72899669e0fa14e46d40ad4be7f))

## [1.9.4-beta.1](https://github.com/analogjs/analog/compare/v1.9.3...v1.9.4-beta.1) (2024-11-14)

### Bug Fixes

- **vite-plugin-angular:** improve support for Angular Material and testing using harnesses ([#1442](https://github.com/analogjs/analog/issues/1442)) ([8338d42](https://github.com/analogjs/analog/commit/8338d4209f1cd72899669e0fa14e46d40ad4be7f))

## [1.9.3](https://github.com/analogjs/analog/compare/v1.9.2...v1.9.3) (2024-11-12)

### Bug Fixes

- **vitest-angular:** set correct type in package.json based on output format ([#1438](https://github.com/analogjs/analog/issues/1438)) ([1f078ff](https://github.com/analogjs/analog/commit/1f078ffb57b559540e43ef5e46e2bff70b652fce))

## [1.9.3-beta.1](https://github.com/analogjs/analog/compare/v1.9.2...v1.9.3-beta.1) (2024-11-08)

### Bug Fixes
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-125-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-126-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<!-- prettier-ignore-end -->

Expand Down Expand Up @@ -272,6 +272,7 @@ Thanks goes to these wonderful people for contributing to Analog ([emoji key](ht
<td align="center" valign="top" width="14.28%"><a href="https://github.com/redfox-mx"><img src="https://avatars.githubusercontent.com/u/20145660?v=4?s=100" width="100px;" alt="Diego Jesús"/><br /><sub><b>Diego Jesús</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=redfox-mx" title="Code">💻</a> <a href="#infra-redfox-mx" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Rockerturner"><img src="https://avatars.githubusercontent.com/u/25847930?v=4?s=100" width="100px;" alt="Rockerturner"/><br /><sub><b>Rockerturner</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=Rockerturner" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://gillespie59.github.io/"><img src="https://avatars.githubusercontent.com/u/555768?v=4?s=100" width="100px;" alt="Emmanuel DEMEY"/><br /><sub><b>Emmanuel DEMEY</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=EmmanuelDemey" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://nickyt.co"><img src="https://avatars.githubusercontent.com/u/833231?v=4?s=100" width="100px;" alt="Nick Taylor"/><br /><sub><b>Nick Taylor</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=nickytonline" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions apps/analog-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"projectType": "application",
"sourceRoot": "apps/analog-app/src",
"prefix": "analogjs",
"implicitDependencies": ["vitest-angular"],
"tags": [],
"targets": {
"build": {
Expand Down
7 changes: 7 additions & 0 deletions apps/analog-app/src/app/about.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-about',
template: `About Store`,
})
export default class AboutComponent {}
15 changes: 13 additions & 2 deletions apps/analog-app/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ import {
provideClientHydration,
withEventReplay,
} from '@angular/platform-browser';
import { provideFileRouter, requestContextInterceptor } from '@analogjs/router';
import {
provideFileRouter,
withExtraRoutes,
requestContextInterceptor,
} from '@analogjs/router';
import { withNavigationErrorHandler } from '@angular/router';

const fallbackRoutes = [
{ path: 'about', loadComponent: () => import('./about') },
];

export const appConfig: ApplicationConfig = {
providers: [
provideFileRouter(withNavigationErrorHandler(console.error)),
provideFileRouter(
withNavigationErrorHandler(console.error),
withExtraRoutes(fallbackRoutes)
),
provideHttpClient(
withFetch(),
withInterceptors([requestContextInterceptor])
Expand Down
2 changes: 1 addition & 1 deletion apps/analog-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineConfig(({ mode }) => {
additionalPagesDirs: ['/libs/shared/feature'],
additionalAPIDirs: ['/libs/shared/feature/src/api'],
prerender: {
routes: ['/', '/cart'],
routes: ['/', '/cart', '/shipping'],
sitemap: {
host: base,
},
Expand Down
1 change: 1 addition & 0 deletions apps/docs-app/docs/contributors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Andres is a software engineer for HeroDevs, Angular and Firebase GDE.
<td align="center" valign="top" width="14.28%"><a href="https://github.com/redfox-mx"><img src="https://avatars.githubusercontent.com/u/20145660?v=4?s=100" width="100px;" alt="Diego Jesús"/><br /><sub><b>Diego Jesús</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=redfox-mx" title="Code">💻</a> <a href="#infra-redfox-mx" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Rockerturner"><img src="https://avatars.githubusercontent.com/u/25847930?v=4?s=100" width="100px;" alt="Rockerturner"/><br /><sub><b>Rockerturner</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=Rockerturner" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://gillespie59.github.io/"><img src="https://avatars.githubusercontent.com/u/555768?v=4?s=100" width="100px;" alt="Emmanuel DEMEY"/><br /><sub><b>Emmanuel DEMEY</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=EmmanuelDemey" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://nickyt.co"><img src="https://avatars.githubusercontent.com/u/833231?v=4?s=100" width="100px;" alt="Nick Taylor"/><br /><sub><b>Nick Taylor</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=nickytonline" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
22 changes: 22 additions & 0 deletions apps/docs-app/docs/features/routing/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,25 @@ The filesystem-based router will generate the following routes:
| `/products/1` | `products/[productId].page.ts` (layout: `products.page.ts`) |
| `/products/1/edit` | `products/[productId].edit.page.ts` (layout: `products.page.ts`) |
| `/unknown-url` | `[...not-found].md` |

## Providing Extra Routes

Routes can be added manually in addition to the routes discovered through the filesystem. Use the `withExtraRoutes` with an array of routes to be prepended to the discovered routes array. All the routes are merged into a single array.

```ts
import { ApplicationConfig } from '@angular/core';
import { Routes } from '@angular/router';
import { provideFileRouter, withExtraRoutes } from '@analogjs/router';

const customRoutes: Routes = [
{
path: '/custom',
loadComponent: () =>
import('./custom-component').then((m) => m.CustomComponent),
},
];

export const appConfig: ApplicationConfig = {
providers: [provideFileRouter(withExtraRoutes(customRoutes))],
};
```
24 changes: 22 additions & 2 deletions apps/docs-app/docs/guides/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export default defineConfig(({ mode }) => ({
mode === 'production' &&
replaceFiles([
{
replace: 'src/environments/environment.ts',
with: 'src/environments/environment.prod.ts',
replace: './src/environments/environment.ts',
with: './src/environments/environment.prod.ts',
},
]),
],
Expand Down Expand Up @@ -172,3 +172,23 @@ Add the environment files to `files` array in the `tsconfig.app.json` may also b
]
}
```

## Copying Assets

Static assets in the `public` directory are copied to the build output directory by default. If you want to copy additional assets outside of that directory, use the `nxCopyAssetsPlugin` Vite plugin.

Import the plugin and set it up:

```ts
/// <reference types="vitest" />

import { defineConfig } from 'vite';
import analog from '@analogjs/platform';
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
// ...
plugins: [analog(), nxCopyAssetsPlugin(['*.md'])],
}));
```
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Andres ist Softwareentwickler für HeroDevs, Angular und Firebase GDE.
<td align="center" valign="top" width="14.28%"><a href="https://github.com/redfox-mx"><img src="https://avatars.githubusercontent.com/u/20145660?v=4?s=100" width="100px;" alt="Diego Jesús"/><br /><sub><b>Diego Jesús</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=redfox-mx" title="Code">💻</a> <a href="#infra-redfox-mx" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Rockerturner"><img src="https://avatars.githubusercontent.com/u/25847930?v=4?s=100" width="100px;" alt="Rockerturner"/><br /><sub><b>Rockerturner</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=Rockerturner" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://gillespie59.github.io/"><img src="https://avatars.githubusercontent.com/u/555768?v=4?s=100" width="100px;" alt="Emmanuel DEMEY"/><br /><sub><b>Emmanuel DEMEY</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=EmmanuelDemey" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://nickyt.co"><img src="https://avatars.githubusercontent.com/u/833231?v=4?s=100" width="100px;" alt="Nick Taylor"/><br /><sub><b>Nick Taylor</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=nickytonline" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Andres es un ingeniero en software para HeroDevs, GDE en Angular y Firebase.
<td align="center" valign="top" width="14.28%"><a href="https://github.com/redfox-mx"><img src="https://avatars.githubusercontent.com/u/20145660?v=4?s=100" width="100px;" alt="Diego Jesús"/><br /><sub><b>Diego Jesús</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=redfox-mx" title="Code">💻</a> <a href="#infra-redfox-mx" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Rockerturner"><img src="https://avatars.githubusercontent.com/u/25847930?v=4?s=100" width="100px;" alt="Rockerturner"/><br /><sub><b>Rockerturner</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=Rockerturner" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://gillespie59.github.io/"><img src="https://avatars.githubusercontent.com/u/555768?v=4?s=100" width="100px;" alt="Emmanuel DEMEY"/><br /><sub><b>Emmanuel DEMEY</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=EmmanuelDemey" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://nickyt.co"><img src="https://avatars.githubusercontent.com/u/833231?v=4?s=100" width="100px;" alt="Nick Taylor"/><br /><sub><b>Nick Taylor</b></sub></a><br /><a href="https://github.com/analogjs/analog/commits?author=nickytonline" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import { RouterOutlet, RouterLink } from '@angular/router' with { analog: 'imports'};
import { delay } from 'rxjs';

import Hello from './hello.analog' with { analog: 'imports'};
import Hello from './hello.ag' with { analog: 'imports'};
import AnotherOne from './another-one.ag' with { analog: 'imports' };
import Highlight from './highlight.analog' with { analog: 'imports' };
import Highlight from './highlight.ag' with { analog: 'imports' };

// components can optionally be imported with no default import name
import './external/external.analog' with { analog: 'imports' };
import './external/external.ag' with { analog: 'imports' };
import { Goodbye } from './my-components' with { analog: 'imports' };
import { HelloOriginal } from './hello' with { analog: 'imports'};
import { MyService } from './my.service' with { analog: 'providers'};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import { outputFromObservable } from '@angular/core/rxjs-interop';
import { interval } from 'rxjs';

import { myFunc } from './export-stuff.analog' with { analog: 'exposes'};
import { myFunc } from './export-stuff.ag' with { analog: 'exposes'};

defineMetadata({
queries: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TestBed } from '@angular/core/testing';
import Hello from './hello.analog';
import Hello from './hello.ag';

describe('Hello', () => {
beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/ng-app/src/app/hello.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import Hello from './hello.analog';
import Hello from './hello.ag';

@Component({
selector: 'app-hello-original',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/ng-app/src/app/my-components.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Goodbye from './goodbye.analog';
import Goodbye from './goodbye.ag';

export { Goodbye };
2 changes: 1 addition & 1 deletion apps/ng-app/src/app/pages/about.page.ag
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { RouteMeta } from '@analogjs/router';
import Hello from '../hello.analog' with { analog: 'imports' };
import Hello from '../hello.ag' with { analog: 'imports' };

export const routeMeta: RouteMeta = {
title: 'My page',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { RouteMeta } from '@analogjs/router';
import Hello from '../hello.analog' with { analog: 'imports' };
import Hello from '../hello.ag' with { analog: 'imports' };

export const routeMeta: RouteMeta = {
title: 'My page',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/ng-app/src/content/post.agx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ coverImage: ''
---

<script lang="ts">
import Hello from '../app/hello.analog' with { analog: 'imports' };
import Hello from '../app/hello.ag' with { analog: 'imports' };

const name = 'Analog';
const greetings = ['Hello', 'Hi'];
Expand Down
2 changes: 1 addition & 1 deletion apps/ng-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'zone.js';
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import AppComponent from './app/app.component.analog';
import AppComponent from './app/app.component.ag';

bootstrapApplication(AppComponent, appConfig).catch((err) =>
console.error(err)
Expand Down
5 changes: 0 additions & 5 deletions apps/ng-app/src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ declare global {
}
}

declare module '*.analog' {
const cmp = any;
export default cmp;
}

declare module '*.ag' {
const cmp = any;
export default cmp;
Expand Down
Loading

0 comments on commit 9c8ce4a

Please sign in to comment.