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

[build] local build supress error message for branches and releasenotes #2870

Closed
Cr4zyc4k3 opened this issue Feb 4, 2024 · 5 comments
Closed

Comments

@Cr4zyc4k3
Copy link
Collaborator

Cr4zyc4k3 commented Feb 4, 2024

image
image
is it possible to delete these messages locally?

Originally posted by @deoxis9001 in #2865 (comment)

@buffcode
Copy link
Contributor

What is the recommended way to detect the local development environment?

I tested wrapping the following blocks with if (BRANCH !== 'dummy') { ... }, so Webpack can drop the code. But probably there is some better check.

@jxn-30
Copy link
Member

jxn-30 commented Feb 10, 2024

What is the recommended way to detect the local development environment?

I tested wrapping the following blocks with if (BRANCH !== 'dummy') { ... }, so Webpack can drop the code. But probably there is some better check.

* Branches: https://github.com/buffcode/LSSM-V.4/blob/271e5e520e31d93883595ce983862d7779d41b94/src/components/settings.vue#L850-L856

* Release notes: https://github.com/buffcode/LSSM-V.4/blob/eb48d37b27fcf6e215bd51956e01c9ad7c6538c0/src/mainpageCore.ts#L135-L138

I would not rely on a check if we're running on a local server as we already did in src/config.ts.
It exports a const PORT_ENV_KEY which could be used: const isLocalServer = typeof process !== 'undefined' && PORT_ENV_KEY in process.env;

Probably, one would have to do that within /build/index.ts and define a global constant within DefinePlugin to handle it correctly und to allow dropping the code accordingly. In combination with correct type in src/global.d.ts that could work.

@buffcode
Copy link
Contributor

buffcode commented Feb 11, 2024

Couldn't we reuse MODE? It currently maps development (which is the default when no mode is specified) to beta.

Either we could refine this and passtrough production | beta | development, or just check for beta at those places as this is also the default for the dev branch.

@jxn-30
Copy link
Member

jxn-30 commented Feb 12, 2024

Distinguishing between beta and development is definitely mandatory in my eyes as we would otherwise supress the error messages at the live beta build.

@Cr4zyc4k3
Copy link
Collaborator Author

Done in #2865 . File download will be done in the prebuild phase.

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

No branches or pull requests

3 participants