Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: test #599

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: test #599

wants to merge 1 commit into from

Conversation

pedromtec
Copy link

What's the purpose of this pull request?

How does it work?

How to test it?

Faststore related PRs

References

Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 1:52pm

@pedromtec pedromtec force-pushed the test/test-redirects-middleware branch from e01be39 to 55be1b8 Compare November 6, 2024 13:50
pedromtec added a commit to vtex/faststore that referenced this pull request Nov 12, 2024
## What's the purpose of this pull request?

This task will allow enabling the redirects middleware within
**@faststore/core** during the build process based on a flag.

The idea is to enable this functionality only for projects that have the
flag `ENABLE_REDIRECTS_MIDDLEWARE` saved in the env vars and which are
hosted by homebrew. In the future, we intend to have control of this
feature through webops.

Next steps: 

- Set this flag in a pipeline env var.
- Implements dynamoDB client (Reference:
#2517)

## How it works?

The key is the name of the file: **middleware__DISABLED.ts**

This middleware is disabled by default. Only stores that are in
**homebrew** and want this functionality will be able to enable it via a
feature flag. When the flag is active, the CLI at build time will check
whether the **ENABLE_REDIRECTS_MIDDLEWARE** flag is set or not, if so,
the file name will be changed to **middleware.ts** and nextjs will know
how to automatically deal with it.

## How to test it?
I created a [PR](vtex-sites/starter.store#599)
with the flag enabled, clone the branch and then:

- Run `yarn build`
- check if the **middleware.ts** was created inside **.faststore/src**

### References


https://docs.google.com/document/d/1iC1fLwJbypnvDyp_JilKBfQfaHjFDHYrjS1kC722sB4/edit?tab=t.0#heading=h.tglo77yl0lf5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant