Add SUPPORTS_LOCAL_API
build flag
#4931
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
SUPPORTS_LOCAL_API
build flagPull Request Type
Description
This pull request adds a new build flag
SUPPORTS_LOCAL_API
. Now that the local API no longer requires Electron specific functionality (e.g. reading and writing to the file system), it makes sense to place the local API behind a different build flag, this will reduce the maintaince burden on @MarmadileManteater for FreeTubeAndroid. This also has no impact on the Electron build, yes I checked therenderer.js
file kept the same size that it had before this pull request (theUniversalCache
class gets correctly treeshaken out).Note for users that might see this pull request and get the wrong idea...
Important
This does not add support for the local API anywhere where it wasn't already supported before (Electron and the Android build in FreeTubeAndroid). Only set this flag to
true
if you know that the local API will actually run in the target environment, that means CORS bypasses and other things have to be in-place.Testing
Electron
Check that the local API still works (you don't need to check everywhere, if it works in a few places, the rest should work too, as I copy pasted the name to avoid typos)
Web
yarn run dev:web
Desktop