Skip to content

Commit

Permalink
docs for hot reloading in flutter (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiagoperes committed Mar 16, 2022
1 parent 520d285 commit cc6124e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
14 changes: 14 additions & 0 deletions content/en/flutter/other/beagle-service.md
Expand Up @@ -24,6 +24,8 @@ These are all the configuration options supported by Beagle Flutter:
11. urlBuilder
12. analyticsProvider
13. enableStyles
14. enableHotReloading
15. hotReloadingUrl

In the sections below, you'll learn how to set each one up.

Expand Down Expand Up @@ -160,6 +162,18 @@ This is a simple boolean option to enable or disable the automatic application o

Setting enableStyles to false is useful when the application will develop all of its components and layout engine. To know more about this, check [this article]({{< ref path="/flutter/layout/styles" lang="en" >}}).

## 14. enableHotReloading
This is a simple boolean option to enable or disable the hot reloading, which is a feature that, when in development mode,
makes the screen update as soon as the code for the BFF changes, making it much easier to develop new UIs.

This feature is only available for BFFs using the Beagle Backend for Typescript, it doesn't work for backends written in
Kotlin. For this reason, this option is set to `false` by default (disabled).

## 15. hotReloadingUrl
URL for the Hot Reloading websocket server. This setting is taken into account only if `enableHotReloading` is `true`.

Default value: `ws://localhost:3001` for iOS and `ws://10.0.2.2:3001` for Android.

# Providing a BeagleService to the application
After instantiating the BeagleService, you must provide it to the application. To do this, wrap your app code in a `BeagleProvider`:

Expand Down
14 changes: 13 additions & 1 deletion content/pt/flutter/other/beagle-service.md
Expand Up @@ -7,7 +7,7 @@ description: Nesta seção, você encontra informações sobre como configurar o
---

# Introdução
A classe BeagleService é o ponto de entrada do Beagle Flutter e onde é feita toda sua configuração. Por padrão, a implementação básica já vem com alguns parâmetros definidos, então não é necessário definí-los.
A classe BeagleService é o ponto de entrada do Beagle Flutter e onde é feita toda sua configuração. Por padrão, a implementação básica já vem com alguns parâmetros definidos, então não é necessário defini-los.

# O que é configurável?
As configurações suportadas pelo BeagleService no Beagle Flutter são as seguintes:
Expand All @@ -25,6 +25,8 @@ As configurações suportadas pelo BeagleService no Beagle Flutter são as segui
11. urlBuilder
12. analyticsProvider
13. enableStyles
14. enableHotReloading
15. hotReloadingUrl

Na continuação desta documentação você aprende sobre cada uma delas

Expand Down Expand Up @@ -165,6 +167,16 @@ Esta é uma opção booleana para habilitar ou desabilitar a aplicação automá

Definir o valor de `enableStyles` como "false" é útil quando o aplicativo desenvolverá todos os seus componentes e mecanismo de layout. Para saber mais sobre isso, consulte [este artigo]({{< ref path="/flutter/layout/styles" lang="pt" >}}).

## 14. enableHotReloading
Esta é uma opção booleana para habilitar ou desabilitar o hot reloading, que é uma feature que, quando em modo desenvolvimento, faz com que a tela atualize assim que o código no BFF muda, tornando muito mais fácil o desenvolvimento de novas UIs.

Este recurso está disponível apenas para BFFs usando o Beagle Backend para Typescript, isso não funciona para backends escritos em Kotlin. Por essa razão, essa opção é definida como `false` por padrão (desabilitado).

## 15. hotReloadingUrl
URL para o servidor de websocket do Hot Reloading. Esta opção só é considerada quando `enableHotReloading` é `true`.

Valor padrão: `ws://localhost:3001` para iOS e `ws://10.0.2.2:3001` para Android.

# Fornecendo um BeagleService a aplicação
Depois de instanciar um BeagleService, é preciso adicioná-lo as configurações de inicialização da aplicação `BeagleProvider`. Veja o exemplo no código a seguir:

Expand Down

0 comments on commit cc6124e

Please sign in to comment.