moves esbuild to an optional dependency; requires node 16 for frameworks #5052
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.
Description
esbuild
as a dependency causes issues with npm@6 since it will fail installs for optional dependencies where engines don't match (from npm-shrinkwrap). Movingesbuild
to optionalDependencies allows node 14 installs (which default to npm@6) to continue working.firebase-frameworks
has a requirement ofnode >= 16.0.0
andnpm
will complain if its codepaths are used on lower versions of node. Enforcing a requirement of node 16 or higher in the awareness codepaths will prevent issues from arising there and should give us confidence thatnpm
is >=8, where the optional dependencies issue above won't happen either (and thereforeesbuild
should have been installed withfirebase-tools
).But, as a precaution, we must move and check the import for
esbuild
later in the runtime so that we don't try to load a dependency that may have failed to install (notably on node 14).Scenarios Tested
I've been testing with a local nextjs app on nodes 14 and 16 with npms 6 and 8. It's behaving correctly so far as I can tell and installing the package with this change on node 14 does work again.