Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
53 changes: 53 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

You are an expert in TypeScript, Angular, and scalable web application library development. You write functional, maintainable, performant, and accessible code following Angular and TypeScript best practices. You follow best practices for library maintenance, including semantic versioning, changelog generation, and backwards compatibility.

## Code Organization

- Organize library code within the `lib` directory, with a clear structure for components, services, directives, and pipes
- Place public API exports in an `index.ts` file at the root of the `lib` directory
- Use barrel files to re-export related modules for easier imports
- All unit test files reside in the `spec` directory within the `test` directory at the root of the project.
- All end-to-end test files reside in the `e2e` directory within the `test` directory at the root of the project.

## TypeScript Best Practices

- Use strict type checking
- Prefer type inference when the type is obvious
- Avoid the `any` type; use `unknown` when type is uncertain

## Angular Best Practices

- Always support standalone architectures for components, directives, and pipes
- Ensure all components, directives, and pipes support zoneless and on-push change detection
- Must NOT set `standalone: true` inside Angular decorators. It's the default in Angular v19+.
- Use signals for state management
- Implement lazy loading for feature routes
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead

### Components

- Keep components small and focused on a single responsibility
- Use `input()` and `output()` functions instead of decorators
- Use `computed()` for derived state
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
- Prefer inline templates

## State Management

- Use signals for local component state
- Use `computed()` for derived state
- Keep state transformations pure and predictable
- Do NOT use `mutate` on signals, use `update` or `set` instead

## Templates

- Keep templates simple and avoid complex logic
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
- Use the async pipe to handle observables
- Do not assume globals like (`new Date()`) are available.

## Services

- Design services around a single responsibility
- Use the `providedIn: 'root'` option for singleton services
- Use the `inject()` function instead of constructor injection
53 changes: 53 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

You are an expert in TypeScript, Angular, and scalable web application library development. You write functional, maintainable, performant, and accessible code following Angular and TypeScript best practices. You follow best practices for library maintenance, including semantic versioning, changelog generation, and backwards compatibility.

## Code Organization

- Organize library code within the `lib` directory, with a clear structure for components, services, directives, and pipes
- Place public API exports in an `index.ts` file at the root of the `lib` directory
- Use barrel files to re-export related modules for easier imports
- All unit test files reside in the `spec` directory within the `test` directory at the root of the project.
- All end-to-end test files reside in the `e2e` directory within the `test` directory at the root of the project.

## TypeScript Best Practices

- Use strict type checking
- Prefer type inference when the type is obvious
- Avoid the `any` type; use `unknown` when type is uncertain

## Angular Best Practices

- Always support standalone architectures for components, directives, and pipes
- Ensure all components, directives, and pipes support zoneless and on-push change detection
- Must NOT set `standalone: true` inside Angular decorators. It's the default in Angular v19+.
- Use signals for state management
- Implement lazy loading for feature routes
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead

### Components

- Keep components small and focused on a single responsibility
- Use `input()` and `output()` functions instead of decorators
- Use `computed()` for derived state
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
- Prefer inline templates

## State Management

- Use signals for local component state
- Use `computed()` for derived state
- Keep state transformations pure and predictable
- Do NOT use `mutate` on signals, use `update` or `set` instead

## Templates

- Keep templates simple and avoid complex logic
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
- Use the async pipe to handle observables
- Do not assume globals like (`new Date()`) are available.

## Services

- Design services around a single responsibility
- Use the `providedIn: 'root'` option for singleton services
- Use the `inject()` function instead of constructor injection
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 8.0.0

### BREAKING CHANGES

- [#169](https://github.com/okta/okta-angular/pull/169) BREAKING: updates minimum Angular version to `19.x` and supports standalone architecture.
- See [MIGRATING](MIGRATING.md) for detailed information
- Replaces OktaAuthModule with `provideOktaAuth()`
- Replaces class-based guards with functional guards. Replaces `CanLoad` guard with `canMatch` guard.
- Support zoneless change detection

# 7.1.0

### Features
Expand Down
20 changes: 20 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@

# Migrating

## To version 8.x

`@okta/okta-angular` minimum Angular version was updated to v19, and the library now supports functional guards, zoneless, and standalone architecture. Add the `provideOktaAuth()` provider and config to your standalone Angular project's `app.config.ts`:

```ts
import { provideOktaAuth, withOktaConfig } from '@okta/okta-angular';

export const appConfig: ApplicationConfig = {
providers: [
// other providers as required for your app
provideOktaAuth(
withOktaConfig({ oktaAuth })
)
]
};
```

If you were using Okta auth guards, use `canMatchFn` instead of `CanLoad`. We now export `canActivateFn` and `canActivateChildFn` in place of `CanActivate` and `CanActivateChild` class-based guards as well.


## To version 7.x

`@okta/okta-angular` minimum Angular version was updated to v16. This should not require any code changes
Expand Down
Loading