diff --git a/.all-contributorsrc b/.all-contributorsrc index 4f170269a..1d2cef602 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -858,6 +858,15 @@ "contributions": [ "doc" ] + }, + { + "login": "leblancmeneses", + "name": "Leblanc Meneses", + "avatar_url": "https://avatars.githubusercontent.com/u/730804?v=4", + "profile": "http://www.robusthaven.com", + "contributions": [ + "infra" + ] } ], "contributorsPerLine": 7, diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cca6b9457..ab9346e8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,25 +14,11 @@ env: VITE_ANALOG_PUBLIC_BASE_URL: ${{ vars.VITE_ANALOG_PUBLIC_BASE_URL || 'http://localhost:3000' }} NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} -jobs: - commitlint: - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - # Required by wagoid/commitlint-github-action - pull-requests: read - steps: - - uses: actions/checkout@v3 - with: - # Required by wagoid/commitlint-github-action - fetch-depth: 0 - - name: Lint commit messages - uses: wagoid/commitlint-github-action@v5 - with: - failOnWarnings: true - helpURL: https://github.com/analogjs/analog/blob/main/CONTRIBUTING.md#-commit-message-guidelines +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true +jobs: prettier: runs-on: ubuntu-latest steps: @@ -155,8 +141,8 @@ jobs: - name: Build run: pnpm exec nx build docs-app - name: Upload docs website - # Runs on merge to the `main` branch - if: github.event_name == 'push' && github.ref_name == 'main' + # Runs on merge to the `beta` branch + if: github.event_name == 'push' && github.ref_name == 'beta' uses: actions/upload-artifact@v3 with: if-no-files-found: error @@ -172,8 +158,8 @@ jobs: - unit - e2e - docs - # Runs on merge to the `main` branch - if: github.event_name == 'push' && github.ref_name == 'main' + # Runs on merge to the `beta` branch + if: github.event_name == 'push' && github.ref_name == 'beta' runs-on: ubuntu-latest environment: name: github-pages @@ -185,7 +171,7 @@ jobs: id-token: write concurrency: # Group concurrency on workflow, then: - # - Is merge run? Group on branch name (`refs/heads/main`) + # - Is merge run? Group on branch name (`refs/heads/beta`) # - Is pull request? Group on pull request branch name, for example `feat/add-awesome-feature` group: >- ${{ github.workflow }}-deploy-docs-${{ diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e33c1b0b..ad885d764 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.1.1](https://github.com/analogjs/analog/compare/v1.1.0...v1.1.1) (2024-04-04) + +### Bug Fixes + +- add TanStack packages for SSR transform ([#998](https://github.com/analogjs/analog/issues/998)) ([0c5d1f6](https://github.com/analogjs/analog/commit/0c5d1f63458e5376cefd8cfb62c2c302bbf80c22)) +- **vite-plugin-angular:** add support for output and model Signal API to Analog SFC ([#1004](https://github.com/analogjs/analog/issues/1004)) ([e212676](https://github.com/analogjs/analog/commit/e212676bb938a53fc59e933f68781e8a45d28cd3)) + # [1.1.0](https://github.com/analogjs/analog/compare/v1.0.2...v1.1.0) (2024-04-02) ### Bug Fixes diff --git a/README.md b/README.md index 5a058d772..5de06fe43 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-90-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-91-orange.svg?style=flat-square)](#contributors-) @@ -203,6 +203,7 @@ Thanks goes to these wonderful people for contributing to Analog ([emoji key](ht Rafael Triantafillidis
Rafael Triantafillidis

💻 Pooya Parsa
Pooya Parsa

📖 Corbin Crutchley
Corbin Crutchley

📖 + Leblanc Meneses
Leblanc Meneses

🚇 diff --git a/apps/docs-app/docs/contributors.mdx b/apps/docs-app/docs/contributors.mdx index 89430ba4a..aaf8fa6f6 100644 --- a/apps/docs-app/docs/contributors.mdx +++ b/apps/docs-app/docs/contributors.mdx @@ -174,6 +174,7 @@ Andres is a software engineer for HeroDevs, Angular and Firebase GDE. Rafael Triantafillidis
Rafael Triantafillidis

💻 Pooya Parsa
Pooya Parsa

📖 Corbin Crutchley
Corbin Crutchley

📖 + Leblanc Meneses
Leblanc Meneses

🚇 diff --git a/apps/docs-app/docs/experimental/sfc/index.md b/apps/docs-app/docs/experimental/sfc/index.md new file mode 100644 index 000000000..6374a0a5c --- /dev/null +++ b/apps/docs-app/docs/experimental/sfc/index.md @@ -0,0 +1,403 @@ +--- +sidebar_position: 1 +--- + +# Analog SFCs + +> **Note:** +> +> This file format and API is experimental, is a community-driven initiative, and is not an officially proposed change to Angular. Use it at your own risk. + +The `.analog` file extension denotes a new file format for Single File Components (SFCs) that aims to simplify the authoring experience and provide Angular-compatible components and directives. + +Together, it combines: + +- Colocated template, script, and style tags +- Use of Angular Signal APIs without decorators +- Performance-first defaults (`OnPush` change detection, no accesss to `ngDoCheck`, etc.) + +## Usage + +To use the Analog SFC, you need to use the Analog Vite plugin or the [Analog Astro plugin](/docs/packages/astro-angular/overview) with an additional flag to enable its usage: + +```typescript +import { defineConfig } from 'vite'; +import analog from '@analogjs/platform'; + +export default defineConfig({ + // ... + plugins: [ + analog({ + vite: { + // Required to use the Analog SFC format + experimental: { + supportAnalogFormat: true, + }, + }, + }), + ], +}); +``` + +> You must also uncomment the type information in the `src/vite-env.d.ts` file. This is temporary while the Analog SFC is experimental. + +### Additional Configuration + +If you are using `.analog` files outside a project's root you need to specify all paths of `.analog` files using globs, like so: + +```typescript +export default defineConfig(({ mode }) => ({ + // ... + plugins: [ + analog({ + vite: { + experimental: { + supportAnalogFormat: { + include: ['/libs/shared/ui/**/*', '/libs/some-lib/ui/**/*'], + }, + }, + }, + }), + ], +})); +``` + +### IDE Support + +To support syntax highlighting and other IDE functionality with `.analog` files, you need to install an extension to support the format for: + +- [WebStorm 2024.1+ or IDEA Ultimate 2024.1+ (EAP)](https://github.com/analogjs/idea-plugin) + +> [Support for VSCode is coming! Please see this issue for more details](https://github.com/analogjs/analog/issues/858/). + +## Authoring an SFC + +Here's a demonstration of the Analog format building a simple counter: + +```html + + + + + +``` + +See the [defineMetadata](#metadata) section for adding additional component metadata. + +## Metadata + +While class decorators are used to add metadata to a component or directive in the traditional Angular authoring methods, they're replaced in the Analog format with the `defineMetadata` global function: + +```typescript +defineMetadata({ + host: { class: 'block articles-toggle' }, +}); +``` + +This supports all of the decorator properties of `@Component` or `@Directive` with a few exceptions. + +### Disallowed Metadata Properties + +The following properties are not allowed on the metadata fields: + +- `template`: Use the SFC `