-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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(27255): allow local modification for remote feature flags #29696
Changes from 1 commit
d4f2f3f
887ed35
4cef487
5e3788b
5c703f2
35fe1f0
473a3bd
caa4b4f
0bff314
d4e79a7
8e88e7f
b1a52ae
b2b5862
a5ea54f
5308bed
2cc1560
248ec01
40f3c07
3a16019
77ad1e5
b09f6a5
9487c17
51b6de6
f3c8e38
2c5ab32
945c42a
f170665
8be5eb3
f2cee6a
3a53d83
a721328
ff643b6
af74af6
7c3ff23
ab7448d
581831c
b120921
e950aa3
b801c6c
84bc8f1
86211f3
b768704
1003d35
4248edf
a199f6f
6e112e8
1071e2b
dcb78e3
96fe46d
9f92cc9
49542c0
0380cf0
d8fb679
5ad5fdb
1e89e33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ const baradDurManifest = isManifestV3 | |
? require('../../app/manifest/v3/_barad_dur.json') | ||
: require('../../app/manifest/v2/_barad_dur.json'); | ||
const { loadBuildTypesConfig } = require('../lib/build-type'); | ||
const manifestFlags = require('../../manifest-flags.json'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
const { TASKS, ENVIRONMENT } = require('./constants'); | ||
const { createTask, composeSeries } = require('./task'); | ||
|
@@ -47,8 +48,10 @@ function createManifestTasks({ | |
browserVersionMap[platform], | ||
await getBuildModifications(buildType, platform), | ||
customArrayMerge, | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
_flags: manifestFlags, | ||
}, | ||
); | ||
|
||
modifyNameAndDescForNonProd(result); | ||
|
||
const dir = path.join('.', 'dist', platform); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import manifestFlags from '../../../../../manifest-flags.json'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
/** | ||
* Returns a function that will transform a manifest JSON object based on the | ||
* given build args. | ||
|
@@ -24,6 +26,17 @@ export function transformManifest(args: { lockdown: boolean; test: boolean }) { | |
} | ||
} | ||
|
||
/** | ||
davidmurdoch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* This function sets predefined flags in the manifest's _flags property. | ||
* | ||
* @param browserManifest - The Chrome extension manifest object to modify | ||
*/ | ||
function addManifestFlags(browserManifest: chrome.runtime.Manifest) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
browserManifest._flags = manifestFlags; | ||
davidmurdoch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
transforms.push(addManifestFlags); | ||
|
||
if (!args.lockdown) { | ||
// remove lockdown scripts from content_scripts | ||
transforms.push(removeLockdown); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5775,4 +5775,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5775,4 +5775,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5775,4 +5775,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5867,4 +5867,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remoteFeatureFlags
in manifest as optional value. We includetestFlagForThreshold
that's created for testing purpose in remote feature flag API .