Skip to content

Commit

Permalink
Update: Rename setFlowSettings to defineFlowSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Aug 27, 2021
1 parent f10f5cf commit d2e1429
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Installer/Distribution/Defaults/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ esbuild:
# This is the same as passing --path to the ./flow configuration:show command
# In Javascript the value is available under the variable FLOW
# (e.g. FLOW.Flownative.Sentry)
setFlowSettings: false
defineFlowSettings: false
# https://esbuild.github.io/api/#log-level
logLevel: info
# https://esbuild.github.io/api/#legal-comments
Expand Down
2 changes: 1 addition & 1 deletion Lib/esbuildHelper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ async function importPlugins() {

const logLevel = config.esbuild?.logLevel || "info";
const legalComments = config.esbuild?.legalComments || "linked";
const flowSettings = readFlowSettings(config.esbuild.setFlowSettings);
const flowSettings = readFlowSettings(config.esbuild.defineFlowSettings);

export { browserlist, logLevel, legalComments, writeFilesToAnotherPackage, importPlugins, flowSettings };
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ By the way: [Alpine.js] is excellent in combination with [Tailwind CSS].
<details>
<summary><strong>Flow Settings in Javascript</strong></summary>

If you use tools like [Flownative.Sentry], you perhaps want to pass some of the settings to your Javascript, without setting a `data` attribute somewhere in the markup. For that, you can enable `esbuild.setFlowSettings`. If set to `true`, all settings are passed. It is recommended to set it to a path (e.g. `Flownative.Sentry`). This path is added as `--path` attribute to the `flow configuration:show` command. If you run `yarn build`, which has automatically the flag `--production`, the `FLOW_CONTEXT` is set to `Production`.
If you use tools like [Flownative.Sentry], you perhaps want to pass some of the settings to your Javascript, without setting a `data` attribute somewhere in the markup. For that, you can enable `esbuild.defineFlowSettings`. If set to `true`, all settings are passed. It is recommended to set it to a path (e.g. `Flownative.Sentry`). This path is added as `--path` attribute to the `flow configuration:show` command. If you run `yarn build`, which has automatically the flag `--production`, the `FLOW_CONTEXT` is set to `Production`.

```yaml
esbuild:
setFlowSettings: Flownative.Sentry
defineFlowSettings: Flownative.Sentry
```

In Javascript, you can access the variables like this:
Expand Down
2 changes: 1 addition & 1 deletion defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ esbuild:
# This is the same as passing --path to the ./flow configuration:show command
# In Javascript the value is available under the variable FLOW
# (e.g. FLOW.Flownative.Sentry)
setFlowSettings: false
defineFlowSettings: false
# https://esbuild.github.io/api/#log-level
logLevel: info
# https://esbuild.github.io/api/#legal-comments
Expand Down

0 comments on commit d2e1429

Please sign in to comment.