analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.5k stars 240 forks source link

client:only support for Astro Angular components #291

Closed R-Bower closed 1 year ago

R-Bower commented 1 year ago

Which scope/s are relevant/related to the feature request?

astro-angular

Information

I'd like to be able to add a client:only directive to Angular components within Astro pages. Relevant Astro docs.

Describe any alternatives/workarounds you're currently using

None

I would be willing to submit a PR to fix this issue

brandonroberts commented 1 year ago

Form looking through the source code, the client:only directive is only if there is only 1 unofficial UI component integration in use. If you are using Angular and React together for example, it's not currently supported.

brandonroberts commented 1 year ago

Example

Works

import { defineConfig } from 'astro/config';
import angular from "@analogjs/astro-angular";

// https://astro.build/config
export default defineConfig({
  outDir: '../../dist/apps/astro-app',
  integrations: [
    angular(),
  ]
});

Does not work

import { defineConfig } from 'astro/config';
import angular from "@analogjs/astro-angular";
import react from '@astrojs/react';

// https://astro.build/config
export default defineConfig({
  outDir: '../../dist/apps/astro-app',
  integrations: [
    angular(),
    react()
  ]
});