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.
This branch now vendors
path-to-regexp
to avoid Arc hydrate grabbing the latest when a consumer of Enhance deploys.See below for historical context.
previous discussion
Don't merge! Pretty sure bad things will happen... 😨
At the moment when Arc hydrate treeshakes the Enhance any-catchall route, there is not package.json so it will install the latest of any discovered package.
This has worked fine because most dependencies here are stable. However, there's a rewrite of
path-to-regexp
in a major version, v8.0.0.The new version is picked up by hydrate this route blows up since the API changed.
You can replicate this locally:
npx @architect/architect hydrate
(this happens on deploy to AWS or Begin)node_modules/@enhance/arc-plugin-enhance/src/http/any-catchall/
/node_modules/path-to-regexp/package.json
v8.0.0
v6.2-ish
I could use the updated v8 of path-to-regexp, but that doesn't really fix the problem.
Instead, I think we should give hydrate a package manifest to work with.
However, I think we've done this before. I believe this would then mean that route would not get dependencies (via treeshaking; which is disabled when a manifest is present) for userland code in
node_modules/@architect/views
. But I can't recall.Another option is to change how hydrate works for plugin-provided Lambdae source directories. It could reference plugin-space package.json for the version. But with
@architect/views
(which isapp/
) it does a merge? idk could be messy.Also relevant: #87
Let's discuss.
In the meantime I will update our router implementation to use the new
path-to-regexp