GithubHelp home page GithubHelp logo

Comments (4)

reginaldbondoc avatar reginaldbondoc commented on July 19, 2024 1

Hi @dangtony98,

I am taking a jab at this and I would like to take a different approach.

Instead of going for runtime access (which will prevent optimization of built frontend package), let's remove the dependency. From the current frontend codebase, I see these:

  1. Only the environment variable NEXT_PUBLIC_WEBSITE_URL is actually being used
  2. One is in next.config.js for CSP and we can use self value for that - you already merged the change re: this
  3. Another is usage as PATH const

I prepared a pull request to fulfill item 3 above. If that is fine, then the only remaining thing is to actually use the frontend image, no need for environment variables at all.

Unless you see the need for environment variable at runtime? In that case, we'll be forced to use a different approach, but that will prevent frontend build optimization. Until then, maybe my approach here will suffice?

from infisical.

dangtony98 avatar dangtony98 commented on July 19, 2024

Hey egi!

I checked the PR and it looked good to me! — Good optimizations to frontend by removing PATH and NEXT_PUBLIC_WEBSITE_URL.

That said, I think there's still one variable that's NEXT_PUBLIC_TELEMETRY_ENABLED that's being used on the frontend for people to opt-out of telemetry at run-time; the remaining variables can be baked into the image build for sure.

from infisical.

reginaldbondoc avatar reginaldbondoc commented on July 19, 2024

Oh, you're right!

In that case, I will continue on finding a solution to this. 🙇

from infisical.

reginaldbondoc avatar reginaldbondoc commented on July 19, 2024

Solution has been accepted and merged.

from infisical.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.