-
Notifications
You must be signed in to change notification settings - Fork 35
Conversation
⏱ Benchmark resultsComparing with d5392a0 largeDepsEsbuild: 10.6s⬇️ 18.96% decrease vs. d5392a0
Legend
largeDepsZisi: 55.3s⬇️ 18.06% decrease vs. d5392a0
Legend
|
// List of supported flags and their default value. | ||
const FLAGS = {} | ||
|
||
const getFlags = (input = {}, flags = FLAGS) => |
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.
[sand] Would (input, flags = FLAGS) => ({ ...flags, ...input })
(or (input, flags = FLAGS) => ({ ...flags, ...removeFalsy(input) })
if input
might contain undefined
keys) be simpler?
One difference is that if input
contains unknown flags, those would not be filtered, but that should not be a problem?
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.
I would actually like FLAGS
to contain all the feature flags that ZISI is currently accepting, and make it so that any supplied flags that don't belong to that list are ignored (e.g. https://github.com/netlify/zip-it-and-ship-it/pull/567/files#diff-84cbdd132bc7ff6db27e194fa841b40864de4a8f661e0a79273ff9b2477e9e3dR11-R15). I think this is important to ensure that any flags used throughout the codebase are declared in one place for greater visibility.
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.
I'll merge this as is for now, but I'm happy to rework this later if you think we should.
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.
Sounds good 👍
- Summary
Unlike Netlify Build, zip-it-and-ship-it doesn't have an official feature flag mechanism. We've been using the functions configuration object to that effect, but that falls short in some situations.
For example, the config is only evaluated when a function is being processed, but we might want to have a feature flag that determines whether a function is even created or not, meaning the feature flag needs to come earlier in the process.
This PR adds a
featureFlags
property that is passed to bothzipFunction
andzipFunctions
and subsequently supplied togetFunctionsFromPaths
.- Test plan
New tests added.
- A picture of a cute animal (not mandatory but encouraged)