Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix prettier issues and replace prettier pre-commit hook #4867

Merged
merged 1 commit into from
Nov 28, 2024
Merged
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ repos:
- id: check-json
- id: check-toml

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
- repo: local
hooks:
- id: prettier
name: prettier
exclude: ^(frontend/|CHANGELOG.md|.github/docker_build_comment_template.md)
additional_dependencies:
- prettier@3.3.3 # SEE: https://github.com/pre-commit/pre-commit/issues/3133
language: system
entry: npx prettier --check

- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/clients/client-side/ios.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ Flagsmith.shared.getFeatureFlags() { (result) in

Note that you can use:

- `flag.value?.stringValue`
- `flag.value?.intValue`
- `flag.value?.stringValue`
- `flag.value?.intValue`

Based on your desired type.

Expand Down
88 changes: 44 additions & 44 deletions docs/docs/clients/server-side.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,57 +24,57 @@ Server Side SDKs can run in 2 different modes: Local Evaluation and Remote Evalu
<Tabs groupId="language" queryString>
<TabItem value="python" label="Python">

- Version Compatibility: **Python 3.8+**
- Source Code: https://github.com/Flagsmith/flagsmith-python-client
- Version Compatibility: **Python 3.8+**
- Source Code: https://github.com/Flagsmith/flagsmith-python-client

</TabItem>
<TabItem value="java" label="Java">

- Version Compatibility: **JDK 11+**
- Source Code: https://github.com/Flagsmith/flagsmith-java-client
- Version Compatibility: **JDK 11+**
- Source Code: https://github.com/Flagsmith/flagsmith-java-client

</TabItem>
<TabItem value="dotnet" label=".NET">

- Version Compatibility: **.NET core 6.0+**
- Source Code: https://github.com/Flagsmith/flagsmith-dotnet-client
- Version Compatibility: **.NET core 6.0+**
- Source Code: https://github.com/Flagsmith/flagsmith-dotnet-client

</TabItem>
<TabItem value="nodejs" label="NodeJS">

- Version Compatibility: **Node 14+**
- Source Code:
- https://github.com/Flagsmith/flagsmith-nodejs-client
- Version Compatibility: **Node 14+**
- Source Code:
- https://github.com/Flagsmith/flagsmith-nodejs-client

</TabItem>
<TabItem value="ruby" label="Ruby">

- Version Compatibility: **Ruby 2.4+**
- Source Code: https://github.com/Flagsmith/flagsmith-ruby-client
- Version Compatibility: **Ruby 2.4+**
- Source Code: https://github.com/Flagsmith/flagsmith-ruby-client

</TabItem>
<TabItem value="php" label="PHP">

- Version Compatibility: **php 7.4+**
- Source Code: https://github.com/Flagsmith/flagsmith-php-client
- Version Compatibility: **php 7.4+**
- Source Code: https://github.com/Flagsmith/flagsmith-php-client

</TabItem>
<TabItem value="go" label="Go">

- Version Compatibility: **Go 1.18+**
- Source Code: https://github.com/Flagsmith/flagsmith-go-client
- Version Compatibility: **Go 1.18+**
- Source Code: https://github.com/Flagsmith/flagsmith-go-client

</TabItem>
<TabItem value="rust" label="Rust">

- Version Compatibility: **2021 edition (1.56.0)+**
- Source Code: https://github.com/Flagsmith/flagsmith-rust-client
- Version Compatibility: **2021 edition (1.56.0)+**
- Source Code: https://github.com/Flagsmith/flagsmith-rust-client

</TabItem>
<TabItem value="elixir" label="Elixir">

- Version Compatibility: **Elixir 1.12+**
- Source Code: https://github.com/Flagsmith/flagsmith-elixir-client
- Version Compatibility: **Elixir 1.12+**
- Source Code: https://github.com/Flagsmith/flagsmith-elixir-client

</TabItem>
</Tabs>
Expand Down Expand Up @@ -572,19 +572,19 @@ secret_button_feature_value = Flagsmith.Client.get_feature_value(flags, "secret_

### When running in [Remote Evaluation mode](/clients#remote-evaluation)

- When requesting Flags for an Identity, all the Traits defined in the SDK will automatically be persisted against the
Identity within the Flagsmith API.
- Traits passed to the SDK will be added to all the other previously persisted Traits associated with that Identity.
- This full set of Traits are then used to evaluate the Flag values for the Identity.
- This all happens in a single request/response.
- When requesting Flags for an Identity, all the Traits defined in the SDK will automatically be persisted against the
Identity within the Flagsmith API.
- Traits passed to the SDK will be added to all the other previously persisted Traits associated with that Identity.
- This full set of Traits are then used to evaluate the Flag values for the Identity.
- This all happens in a single request/response.

### When running in [Local Evaluation mode](/clients#local-evaluation)

- _Only_ the Traits provided to the SDK at runtime will be used. Local Evaluation mode, by design, does not make any
network requests to the Flagsmith API when evaluating Flags for an Identity.
- When running in Local Evaluation Mode, the SDK requests the
[Environment Document](/clients#the-environment-document) from the Flagsmith API. This contains all the
information required to make Flag Evaluations, but it does _not_ contain any Trait data.
- _Only_ the Traits provided to the SDK at runtime will be used. Local Evaluation mode, by design, does not make any
network requests to the Flagsmith API when evaluating Flags for an Identity.
- When running in Local Evaluation Mode, the SDK requests the
[Environment Document](/clients#the-environment-document) from the Flagsmith API. This contains all the
information required to make Flag Evaluations, but it does _not_ contain any Trait data.

## Managing Default Flags

Expand Down Expand Up @@ -983,10 +983,10 @@ The Server Side SDKS share the same network behaviour across the different langu

### Remote Evaluation Mode Network Behaviour

- A blocking network request is made every time you make a call to get an Environment Flags. In Python, for example,
`flagsmith.get_environment_flags()` will trigger this request.
- A blocking network request is made every time you make a call to get an Identities Flags. In Python, for example,
`flagsmith.get_identity_flags(identifier=identifier, traits=traits)` will trigger this request.
- A blocking network request is made every time you make a call to get an Environment Flags. In Python, for example,
`flagsmith.get_environment_flags()` will trigger this request.
- A blocking network request is made every time you make a call to get an Identities Flags. In Python, for example,
`flagsmith.get_identity_flags(identifier=identifier, traits=traits)` will trigger this request.

### Local Evaluation Mode Network Behaviour

Expand All @@ -998,9 +998,9 @@ To use Local Evaluation mode, you must use a Server Side key.

:::

- When the SDK is initialised, it will make an asynchronous network request to retrieve details about the Environment.
- Every 60 seconds (by default), it will repeat this aysnchronous request to ensure that the Environment information
it has is up to date.
- When the SDK is initialised, it will make an asynchronous network request to retrieve details about the Environment.
- Every 60 seconds (by default), it will repeat this aysnchronous request to ensure that the Environment information it
has is up to date.

To achieve Local Evaluation, in most languages, the SDK spawns a separate thread (or equivalent) to poll the API for
changes to the Environment. In certain languages, you may be required to terminate this thread before cleaning up the
Expand Down Expand Up @@ -1793,9 +1793,9 @@ Flagsmith uses [Caffeine](https://github.com/ben-manes/caffeine), a high perform
If you enable caching on the Flagsmith client without setting any values (as shown below), the following default values
will be set for you:

- `maxSize(10)`
- `expireAfterWrite(5, TimeUnit.MINUTES)`
- project level caching will be disabled by default (i.e. only enabled if you configure a caching key)
- `maxSize(10)`
- `expireAfterWrite(5, TimeUnit.MINUTES)`
- project level caching will be disabled by default (i.e. only enabled if you configure a caching key)

```java
// use in-memory caching with Flagsmith defaults as described above
Expand Down Expand Up @@ -1978,11 +1978,11 @@ $flagsmith->updateEnvironment();

Note:

- For the environment cache, please use the server key generated from the Flagsmith Settings menu. The key's prefix is
`ser.`.
- The cache is important for concurrent requests. Without the cache, each request in PHP is a different process with
its own memory objects. The cache (filesystem or other) would enforce that the network call is reduced to a file
system one.
- For the environment cache, please use the server key generated from the Flagsmith Settings menu. The key's prefix is
`ser.`.
- The cache is important for concurrent requests. Without the cache, each request in PHP is a different process with its
own memory objects. The cache (filesystem or other) would enforce that the network call is reduced to a file system
one.

</TabItem>
</Tabs>
Expand Down
22 changes: 11 additions & 11 deletions docs/docs/pricing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ API request.

The billable API requests your application makes depends mainly on which [flag evaluation mode](/clients) it uses:

- Remote Evaluation is the default for all applications. Applications using Remote Evaluation call the Flagsmith API
when they need to fetch the flags for the current environment or user.
- Local Evaluation is optional, and only for server-side applications. Each individual application or
[Edge Proxy](/advanced-use/edge-proxy) instance polls the Flagsmith API at a configurable interval (60 seconds by
default) to fetch the flags for the current environment and all users in one API request.
- Remote Evaluation is the default for all applications. Applications using Remote Evaluation call the Flagsmith API
when they need to fetch the flags for the current environment or user.
- Local Evaluation is optional, and only for server-side applications. Each individual application or
[Edge Proxy](/advanced-use/edge-proxy) instance polls the Flagsmith API at a configurable interval (60 seconds by
default) to fetch the flags for the current environment and all users in one API request.

The following requests are not billable:

- [Admin API](/clients/rest#private-admin-api-endpoints) requests.
- Requests made by Flagsmith SDKs to track [Flag Analytics](/advanced-use/flag-analytics).
- Connecting to a [real-time flag updates](/advanced-use/real-time-flags) stream.
- [Admin API](/clients/rest#private-admin-api-endpoints) requests.
- Requests made by Flagsmith SDKs to track [Flag Analytics](/advanced-use/flag-analytics).
- Connecting to a [real-time flag updates](/advanced-use/real-time-flags) stream.

### Example: client-side application

Expand Down Expand Up @@ -85,9 +85,9 @@ its lifecycle could look like this:

"Service" in this context refers to any of the following:

- An instance of your application, running in a container or server, using the Flagsmith SDK with Local Evaluation
enabled.
- An [Edge Proxy](/advanced-use/edge-proxy) container instance.
- An instance of your application, running in a container or server, using the Flagsmith SDK with Local Evaluation
enabled.
- An [Edge Proxy](/advanced-use/edge-proxy) container instance.

Following the example above, if you used the default polling frequency of 60 seconds, you could estimate your monthly
API usage as:
Expand Down
Loading