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

feat(web): get Env from API endpoint #678

Merged
merged 22 commits into from
Feb 13, 2025
Merged

feat(web): get Env from API endpoint #678

merged 22 commits into from
Feb 13, 2025

Conversation

xFJA
Copy link
Collaborator

@xFJA xFJA commented Jan 9, 2025

Checklist

  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

The environment variables on the client side are now obtained from an api endpoint when the app initializes. This way, you should be able to change their values without redeploying for future deployment changes.

Related Issue (Optional)

Closes #87

Copy link

changeset-bot bot commented Jan 9, 2025

🦋 Changeset detected

Latest commit: d80e5ea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@blobscan/web Minor

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

Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blobscan-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 2:53pm
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
blobscan-docs ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 2:53pm
blobscan-gnosis ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 2:53pm
blobscan-holesky ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 2:53pm
blobscan-mainnet ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 2:53pm
blobscan-sepolia ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 2:53pm

@xFJA xFJA changed the title feat: get Env from API endpoint feat(web): get Env from API endpoint Jan 9, 2025
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.81%. Comparing base (27cddc4) to head (d80e5ea).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #678      +/-   ##
==========================================
+ Coverage   88.57%   88.81%   +0.23%     
==========================================
  Files         162      163       +1     
  Lines       11060    11073      +13     
  Branches     1208     1208              
==========================================
+ Hits         9796     9834      +38     
+ Misses       1264     1239      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Jan 9, 2025

📦 Next.js Bundle Analysis for @blobscan/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Member

@PJColombo PJColombo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good.

I left some comments with some changes we should do.

Copy link
Member

@PJColombo PJColombo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some more comments.

@PJColombo PJColombo merged commit 22ae59a into main Feb 13, 2025
14 checks passed
@PJColombo PJColombo deleted the create-env-endpoint branch February 13, 2025 14:54
@github-actions github-actions bot mentioned this pull request Feb 13, 2025
luis-herasme pushed a commit that referenced this pull request Feb 24, 2025
* feat(web): fetch env from API endpoint in client side

* feat(web): adapt server side sentry env config for any environment

* fix(web): limit to '1' env query

* refactor(web): reset 'server' and 'edge' sentry config

* refactor(web): move env endpoint from API package to Next API

* feat: remove default env value

* feat(web): use Next env api endpoint to init sentry in clientside

* chore(web): remove unnecessary export

* refactor(web): remove unnecessary env fetch utils file

* feat(web): validate env API request json parsing

* chore(web): update changeset

* refactor(web): infer clien env zod schema in Env provider

* feat(web): update client vars schema

* feat(web): update client env var references after name refactor

* style(web): type provider env vars

* chore: update `pnpm-lock`

* chore(web): remove `NEXT` prefix env vars

* chore(web): parse env vars fetched from api

* chore(web): use type casting instead of Zod schema parsing on client as env vars are already parsed on the server

* chore(web): fix blobscan version info

---------

Co-authored-by: PJColombo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show network name
3 participants