# Development Environment

To help with development, and prevent some sneaky bugs that can be hard to debug, ActiveJS provides a few checks that you can enable in a development environment. You can configure them like this.

```typescript
Configuration.set({
    checkUniqueId: true, // default is false
    checkImmutability: true, // default is false
    checkSerializability: true // default is false
})
```

ActiveJS provides the following checks:

* **`checkImmutability`** Enables immutability violation checks for all the ActiveJS constructs, it blocks any attempts of state mutation and throws an error with information about where the violation occurred.
* **`checkUniqueId`** Enables unique id checks across all the ActiveJS constructs, such that if any of the two ActiveJS instances have the same id, it'll throw an error.
* **`checkSerializability`** Enables serializability checks for Units and Actions, it'll throw an error if a non-serializable value is passed to an Action or Unit.

See [API reference](https://api.activejs.dev/interfaces/environmentconfig) for more details.

### Notes

* You should only use these checks in a development environment to avoid causing unwarranted errors in a production deployment.
* To automate this process you can use an environment variable provided by the framework of your choice, that identifies the development environment, and enable ActiveJS' production mode to disable all the checks.\
  e.g.: in Angular it'd look like this

  ```typescript
  // in the app.module.ts

  if (environment.production) {
    Configuration.enableProdMode();
  }
  ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.activejs.dev/activejs/guides/development-environment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
