-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feat(react/app): environment variables #2180
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🦋 Changeset detectedLatest commit: e67edff The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
github-actions
bot
added
👨🏻🍳 cookbooks
👾 React
📚 documentation
Improvements or additions to documentation
🚀 feature
New feature or request
🧨 breaking changes
labels
May 23, 2024
odinr
changed the title
Feat/app/environment variables
Feat(react/app): environment variables
May 23, 2024
odinr
force-pushed
the
feat/app/environment-variables
branch
from
May 23, 2024 07:18
0eccd05
to
f31189a
Compare
odinr
force-pushed
the
feat/app/environment-variables
branch
from
May 23, 2024 07:19
f31189a
to
bd3b27c
Compare
odinr
force-pushed
the
feat/app/environment-variables
branch
from
May 23, 2024 07:37
bd3b27c
to
59d1962
Compare
odinr
force-pushed
the
feat/app/environment-variables
branch
from
May 23, 2024 07:48
bdc0d96
to
2905ac4
Compare
Coverage Report
File Coverage
|
AndrejNikolicEq
approved these changes
May 23, 2024
Add a new React hook 'useAppEnvironmentVariables' to access the application's environment variables from the app module. The hook returns an observable state containing the environment configuration. The changes include: - Add 'useAppEnvironmentVariables.ts' file with the hook implementation - Export the new hook from 'index.ts' - Update 'tsconfig.json' to include a reference to the 'observable' package
…t app Add a new cookbook demonstrating how to use the `useAppEnvironmentVariables` hook to access environment variables in a Fusion Framework React application. The cookbook includes: - App configuration file (`app.config.ts`) defining environment variables and endpoints - App manifest configuration file (`app.manifest.config.ts`) - `package.json` with scripts and dependencies - `src/App.tsx` component using the `useAppEnvironmentVariables` hook - `src/config.ts` for configuring the application - `src/index.ts` for rendering the application
Add a new section to the "Getting started" guide, explaining how to access environment variables in the application using the `useAppEnvironmentVariables` hook from `@equinor/fusion-framework-react-app`. Add a code example demonstrating the usage of the hook.
odinr
force-pushed
the
feat/app/environment-variables
branch
from
May 23, 2024 11:03
2905ac4
to
e67edff
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
👨🏻🍳 cookbooks
📚 documentation
Improvements or additions to documentation
🚀 feature
New feature or request
👾 React
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
This PR introduces the following changes:
useAppEnvironmentVariables
hook to the@equinor/fusion-framework-react-app
package, allowing React components to access the application's environment variables.@equinor/fusion-framework-cookbook-app-react-environment-variables
that demonstrates how to use theuseAppEnvironmentVariables
hook.The current behavior is that there is no built-in way to access the application's environment variables from React components. This PR introduces a new hook that fills this gap, making it easier for developers to retrieve and use the environment configuration in their applications.
This PR does not introduce any breaking changes.
fixes: https://github.com/equinor/fusion/issues/355
Check off the following:
Confirm that I checked changes to branch which I am merging into.
Confirm that the I have completed the self-review checklist.
Confirm that my changes meet our code of conduct.