mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
perf: remove data-testid in production (#2228)
Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
1
.github/workflows/release-desktop-app.yml
vendored
1
.github/workflows/release-desktop-app.yml
vendored
@@ -63,6 +63,7 @@ jobs:
|
||||
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
API_SERVER_PROFILE: prod
|
||||
ENABLE_TEST_PROPERTIES: false
|
||||
|
||||
- name: Upload Artifact (web-static)
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
@@ -80,6 +80,11 @@ const nextConfig = {
|
||||
removeConsole: {
|
||||
exclude: ['error', 'log', 'warn', 'info'],
|
||||
},
|
||||
reactRemoveProperties: !buildFlags.enableTestProperties
|
||||
? {
|
||||
properties: ['^data-testid$'],
|
||||
}
|
||||
: false,
|
||||
emotion: {
|
||||
sourceMap: true,
|
||||
},
|
||||
|
||||
@@ -18,6 +18,9 @@ export const blockSuiteFeatureFlags = {
|
||||
* @type {import('@affine/env').BuildFlags}
|
||||
*/
|
||||
export const buildFlags = {
|
||||
enableTestProperties: process.env.ENABLE_TEST_PROPERTIES
|
||||
? process.env.ENABLE_TEST_PROPERTIES === 'true'
|
||||
: true,
|
||||
enableLegacyCloud: process.env.ENABLE_LEGACY_PROVIDER
|
||||
? process.env.ENABLE_LEGACY_PROVIDER === 'true'
|
||||
: true,
|
||||
|
||||
1
packages/env/src/config.ts
vendored
1
packages/env/src/config.ts
vendored
@@ -6,6 +6,7 @@ import { z } from 'zod';
|
||||
import { getUaHelper } from './ua-helper';
|
||||
|
||||
export const buildFlagsSchema = z.object({
|
||||
enableTestProperties: z.boolean(),
|
||||
enableBroadCastChannelProvider: z.boolean(),
|
||||
enableDebugPage: z.boolean(),
|
||||
enableLegacyCloud: z.boolean(),
|
||||
|
||||
Reference in New Issue
Block a user