Skip to content

Commit 1d7882e

Browse files
Lukas Holzerjobala
andauthored
refactor: cleanup rolled out feature flag (#4855)
* refactor: cleanup rolled out feature flag * chore: remove advanced serialization * chore: cleanup snapshots --------- Co-authored-by: Japheth Obala <[email protected]>
1 parent 4dc505a commit 1d7882e

File tree

7 files changed

+14
-167
lines changed

7 files changed

+14
-167
lines changed

packages/build/src/plugins/spawn.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const CHILD_MAIN_FILE = fileURLToPath(new URL('child/main.js', import.meta.url))
2222
// (for both security and safety reasons)
2323
// - logs can be buffered which allows manipulating them for log shipping,
2424
// transforming and parallel plugins
25-
const tStartPlugins = async function ({ pluginsOptions, buildDir, childEnv, logs, debug, featureFlags, quiet }) {
25+
const tStartPlugins = async function ({ pluginsOptions, buildDir, childEnv, logs, debug, quiet }) {
2626
if (!quiet) {
2727
logRuntime(logs, pluginsOptions)
2828
logLoadingPlugins(logs, pluginsOptions, debug)
@@ -32,16 +32,14 @@ const tStartPlugins = async function ({ pluginsOptions, buildDir, childEnv, logs
3232
logIncompatiblePlugins(logs, pluginsOptions)
3333

3434
const childProcesses = await Promise.all(
35-
pluginsOptions.map(({ pluginDir, nodePath }) =>
36-
startPlugin({ pluginDir, nodePath, buildDir, childEnv, featureFlags }),
37-
),
35+
pluginsOptions.map(({ pluginDir, nodePath }) => startPlugin({ pluginDir, nodePath, buildDir, childEnv })),
3836
)
3937
return { childProcesses }
4038
}
4139

4240
export const startPlugins = measureDuration(tStartPlugins, 'start_plugins')
4341

44-
const startPlugin = async function ({ pluginDir, nodePath, buildDir, childEnv, featureFlags }) {
42+
const startPlugin = async function ({ pluginDir, nodePath, buildDir, childEnv }) {
4543
const childProcess = execaNode(CHILD_MAIN_FILE, [], {
4644
cwd: buildDir,
4745
preferLocal: true,
@@ -50,11 +48,6 @@ const startPlugin = async function ({ pluginDir, nodePath, buildDir, childEnv, f
5048
execPath: nodePath,
5149
env: childEnv,
5250
extendEnv: false,
53-
// Feature flag: https://app.launchdarkly.com/default/production/features/netlify_build_use_json_serialization_for_plugin_ipc/targeting
54-
// TODO: remove feature flag once fully rolled out
55-
...(!featureFlags.netlify_build_use_json_serialization_for_plugin_ipc && {
56-
serialization: 'advanced',
57-
}),
5851
})
5952

6053
try {

packages/build/tests/core/snapshots/tests.js.md

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,106 +1609,6 @@ Generated by [AVA](https://avajs.dev).
16091609
(Netlify Build completed in 1ms)␊
16101610
Build step duration: Netlify Build completed in 1ms`
16111611

1612-
## Successfully builds ES module function with feature flag
1613-
1614-
> Snapshot 1
1615-
1616-
`␊
1617-
Netlify Build ␊
1618-
────────────────────────────────────────────────────────────────␊
1619-
1620-
> Version␊
1621-
@netlify/build 1.0.0␊
1622-
1623-
> Flags␊
1624-
debug: true␊
1625-
featureFlags:␊
1626-
- buildbot_es_modules_esbuild␊
1627-
repositoryRoot: packages/build/tests/core/fixtures/functions_es_modules␊
1628-
testOpts:␊
1629-
pluginsListUrl: test␊
1630-
silentLingeringProcesses: true␊
1631-
1632-
> Current directory␊
1633-
packages/build/tests/core/fixtures/functions_es_modules␊
1634-
1635-
> Config file␊
1636-
packages/build/tests/core/fixtures/functions_es_modules/netlify.toml␊
1637-
1638-
> Resolved config␊
1639-
build:␊
1640-
publish: packages/build/tests/core/fixtures/functions_es_modules␊
1641-
publishOrigin: default␊
1642-
functionsDirectory: packages/build/tests/core/fixtures/functions_es_modules/functions␊
1643-
1644-
> Context␊
1645-
production␊
1646-
1647-
1. Functions bundling ␊
1648-
────────────────────────────────────────────────────────────────␊
1649-
1650-
Packaging Functions from functions directory:␊
1651-
- function_with_es_module.js␊
1652-
1653-
1654-
(Functions bundling completed in 1ms)␊
1655-
Build step duration: Functions bundling completed in 1ms␊
1656-
1657-
Netlify Build Complete ␊
1658-
────────────────────────────────────────────────────────────────␊
1659-
1660-
(Netlify Build completed in 1ms)␊
1661-
Build step duration: Netlify Build completed in 1ms`
1662-
1663-
## Doesn't fail build for ES module function if feature flag is off
1664-
1665-
> Snapshot 1
1666-
1667-
`␊
1668-
Netlify Build ␊
1669-
────────────────────────────────────────────────────────────────␊
1670-
1671-
> Version␊
1672-
@netlify/build 1.0.0␊
1673-
1674-
> Flags␊
1675-
debug: true␊
1676-
repositoryRoot: packages/build/tests/core/fixtures/functions_es_modules␊
1677-
testOpts:␊
1678-
pluginsListUrl: test␊
1679-
silentLingeringProcesses: true␊
1680-
1681-
> Current directory␊
1682-
packages/build/tests/core/fixtures/functions_es_modules␊
1683-
1684-
> Config file␊
1685-
packages/build/tests/core/fixtures/functions_es_modules/netlify.toml␊
1686-
1687-
> Resolved config␊
1688-
build:␊
1689-
publish: packages/build/tests/core/fixtures/functions_es_modules␊
1690-
publishOrigin: default␊
1691-
functionsDirectory: packages/build/tests/core/fixtures/functions_es_modules/functions␊
1692-
1693-
> Context␊
1694-
production␊
1695-
1696-
1. Functions bundling ␊
1697-
────────────────────────────────────────────────────────────────␊
1698-
1699-
Packaging Functions from functions directory:␊
1700-
- function_with_es_module.js␊
1701-
1702-
1703-
(Functions bundling completed in 1ms)␊
1704-
Build step duration: Functions bundling completed in 1ms␊
1705-
1706-
Netlify Build Complete ␊
1707-
────────────────────────────────────────────────────────────────␊
1708-
1709-
(Netlify Build completed in 1ms)␊
1710-
Build step duration: Netlify Build completed in 1ms`
1711-
17121612
## Functions config is passed to zip-it-and-ship-it (1)
17131613

17141614
> Snapshot 1
-161 Bytes
Binary file not shown.
-2 Bytes
Binary file not shown.

packages/build/tests/plugins/tests.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,6 @@ test('Does not transpile already transpiled local plugins', async (t) => {
263263
})
264264

265265
test('Plugins which export a factory function receive the inputs and a metadata object', async (t) => {
266-
const output = await new Fixture('./fixtures/dynamic_plugin')
267-
.withFlags({
268-
featureFlags: {
269-
netlify_build_use_json_serialization_for_plugin_ipc: true,
270-
},
271-
})
272-
.runWithBuild()
266+
const output = await new Fixture('./fixtures/dynamic_plugin').runWithBuild()
273267
t.snapshot(normalizeOutput(output))
274268
})

packages/build/tests/plugins_events/snapshots/tests.js.md

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,14 +1460,10 @@ Generated by [AVA](https://avajs.dev).
14601460
CACHE_DIR: '.netlify/cache',␊
14611461
IS_LOCAL: true,␊
14621462
NETLIFY_BUILD_VERSION: '1.0.0',␊
1463-
SITE_ID: undefined,␊
1464-
NETLIFY_API_TOKEN: undefined,␊
14651463
NETLIFY_API_HOST: 'api.netlify.com',␊
14661464
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
14671465
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1468-
PUBLISH_DIR: '.',␊
1469-
FUNCTIONS_SRC: undefined,␊
1470-
EDGE_FUNCTIONS_SRC: undefined␊
1466+
PUBLISH_DIR: '.'␊
14711467
}␊
14721468
14731469
(./plugin.js onPreBuild completed in 1ms)␊
@@ -1482,14 +1478,10 @@ Generated by [AVA](https://avajs.dev).
14821478
CACHE_DIR: '.netlify/cache',␊
14831479
IS_LOCAL: true,␊
14841480
NETLIFY_BUILD_VERSION: '1.0.0',␊
1485-
SITE_ID: undefined,␊
1486-
NETLIFY_API_TOKEN: undefined,␊
14871481
NETLIFY_API_HOST: 'api.netlify.com',␊
14881482
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
14891483
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1490-
PUBLISH_DIR: '.',␊
1491-
FUNCTIONS_SRC: undefined,␊
1492-
EDGE_FUNCTIONS_SRC: undefined␊
1484+
PUBLISH_DIR: '.'␊
14931485
}␊
14941486
14951487
(./plugin.js onBuild completed in 1ms)␊
@@ -1504,14 +1496,10 @@ Generated by [AVA](https://avajs.dev).
15041496
CACHE_DIR: '.netlify/cache',␊
15051497
IS_LOCAL: true,␊
15061498
NETLIFY_BUILD_VERSION: '1.0.0',␊
1507-
SITE_ID: undefined,␊
1508-
NETLIFY_API_TOKEN: undefined,␊
15091499
NETLIFY_API_HOST: 'api.netlify.com',␊
15101500
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
15111501
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1512-
PUBLISH_DIR: '.',␊
1513-
FUNCTIONS_SRC: undefined,␊
1514-
EDGE_FUNCTIONS_SRC: undefined␊
1502+
PUBLISH_DIR: '.'␊
15151503
}␊
15161504
15171505
(./plugin.js onPostBuild completed in 1ms)␊
@@ -1526,14 +1514,10 @@ Generated by [AVA](https://avajs.dev).
15261514
CACHE_DIR: '.netlify/cache',␊
15271515
IS_LOCAL: true,␊
15281516
NETLIFY_BUILD_VERSION: '1.0.0',␊
1529-
SITE_ID: undefined,␊
1530-
NETLIFY_API_TOKEN: undefined,␊
15311517
NETLIFY_API_HOST: 'api.netlify.com',␊
15321518
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
15331519
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1534-
PUBLISH_DIR: '.',␊
1535-
FUNCTIONS_SRC: undefined,␊
1536-
EDGE_FUNCTIONS_SRC: undefined␊
1520+
PUBLISH_DIR: '.'␊
15371521
}␊
15381522
15391523
(./plugin.js onSuccess completed in 1ms)␊
@@ -1548,14 +1532,10 @@ Generated by [AVA](https://avajs.dev).
15481532
CACHE_DIR: '.netlify/cache',␊
15491533
IS_LOCAL: true,␊
15501534
NETLIFY_BUILD_VERSION: '1.0.0',␊
1551-
SITE_ID: undefined,␊
1552-
NETLIFY_API_TOKEN: undefined,␊
15531535
NETLIFY_API_HOST: 'api.netlify.com',␊
15541536
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
15551537
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1556-
PUBLISH_DIR: '.',␊
1557-
FUNCTIONS_SRC: undefined,␊
1558-
EDGE_FUNCTIONS_SRC: undefined␊
1538+
PUBLISH_DIR: '.'␊
15591539
}␊
15601540
15611541
(./plugin.js onEnd completed in 1ms)␊
@@ -1601,14 +1581,10 @@ Generated by [AVA](https://avajs.dev).
16011581
CACHE_DIR: '.netlify/cache',␊
16021582
IS_LOCAL: true,␊
16031583
NETLIFY_BUILD_VERSION: '1.0.0',␊
1604-
SITE_ID: undefined,␊
1605-
NETLIFY_API_TOKEN: undefined,␊
16061584
NETLIFY_API_HOST: 'api.netlify.com',␊
16071585
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
16081586
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1609-
PUBLISH_DIR: '.',␊
1610-
FUNCTIONS_SRC: undefined,␊
1611-
EDGE_FUNCTIONS_SRC: undefined␊
1587+
PUBLISH_DIR: '.'␊
16121588
}␊
16131589
16141590
(./plugin.js onPreDev completed in 1ms)␊
@@ -1623,14 +1599,10 @@ Generated by [AVA](https://avajs.dev).
16231599
CACHE_DIR: '.netlify/cache',␊
16241600
IS_LOCAL: true,␊
16251601
NETLIFY_BUILD_VERSION: '1.0.0',␊
1626-
SITE_ID: undefined,␊
1627-
NETLIFY_API_TOKEN: undefined,␊
16281602
NETLIFY_API_HOST: 'api.netlify.com',␊
16291603
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
16301604
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1631-
PUBLISH_DIR: '.',␊
1632-
FUNCTIONS_SRC: undefined,␊
1633-
EDGE_FUNCTIONS_SRC: undefined␊
1605+
PUBLISH_DIR: '.'␊
16341606
}␊
16351607
16361608
(./plugin.js onDev completed in 1ms)␊
@@ -1652,14 +1624,10 @@ Generated by [AVA](https://avajs.dev).
16521624
CACHE_DIR: '.netlify/cache',␊
16531625
IS_LOCAL: true,␊
16541626
NETLIFY_BUILD_VERSION: '1.0.0',␊
1655-
SITE_ID: undefined,␊
1656-
NETLIFY_API_TOKEN: undefined,␊
16571627
NETLIFY_API_HOST: 'api.netlify.com',␊
16581628
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
16591629
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1660-
PUBLISH_DIR: '.',␊
1661-
FUNCTIONS_SRC: undefined,␊
1662-
EDGE_FUNCTIONS_SRC: undefined␊
1630+
PUBLISH_DIR: '.'␊
16631631
}␊
16641632
onDev: {␊
16651633
CONFIG_PATH: 'netlify.toml',␊
@@ -1668,14 +1636,10 @@ Generated by [AVA](https://avajs.dev).
16681636
CACHE_DIR: '.netlify/cache',␊
16691637
IS_LOCAL: true,␊
16701638
NETLIFY_BUILD_VERSION: '1.0.0',␊
1671-
SITE_ID: undefined,␊
1672-
NETLIFY_API_TOKEN: undefined,␊
16731639
NETLIFY_API_HOST: 'api.netlify.com',␊
16741640
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
16751641
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1676-
PUBLISH_DIR: '.',␊
1677-
FUNCTIONS_SRC: undefined,␊
1678-
EDGE_FUNCTIONS_SRC: undefined␊
1642+
PUBLISH_DIR: '.'␊
16791643
}`
16801644

16811645
## Shows error information in the `startDev` entrypoint even when `quiet: true`
@@ -1689,14 +1653,10 @@ Generated by [AVA](https://avajs.dev).
16891653
CACHE_DIR: '.netlify/cache',␊
16901654
IS_LOCAL: true,␊
16911655
NETLIFY_BUILD_VERSION: '1.0.0',␊
1692-
SITE_ID: undefined,␊
1693-
NETLIFY_API_TOKEN: undefined,␊
16941656
NETLIFY_API_HOST: 'api.netlify.com',␊
16951657
INTERNAL_FUNCTIONS_SRC: '.netlify/functions-internal',␊
16961658
INTERNAL_EDGE_FUNCTIONS_SRC: '.netlify/edge-functions',␊
1697-
PUBLISH_DIR: '.',␊
1698-
FUNCTIONS_SRC: undefined,␊
1699-
EDGE_FUNCTIONS_SRC: undefined␊
1659+
PUBLISH_DIR: '.'␊
17001660
}␊
17011661
17021662
Plugin "./plugin.js" internal error ␊
-43 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)