Legacy como padrão com redirect para app moderna#5
Draft
jandersonss wants to merge 3 commits into
Draft
Conversation
- Middleware redireciona browsers antigos para /legacy antes do Next carregar - Script na página legacy envia browsers modernos para o app com forceModern=1 - Home legacy com hero rotativo, continuar assistindo e cards de categorias - Login e layout alinhados ao design da app principal Co-authored-by: Janderson Lemos <jsolemos@gmail.com>
- Busca trending, lançamentos e gêneros via API TMDb - Cruza resultados com catálogo IPTV (mesma lógica da app moderna) - Painel para configurar chave TMDb direto no legacy Co-authored-by: Janderson Lemos <jsolemos@gmail.com>
- legacy-root fica vazio no SSR (suppressHydrationWarning) - Loader inicial em legacy-boot, removido ao montar o bundle Co-authored-by: Janderson Lemos <jsolemos@gmail.com>
jandersonss
force-pushed
the
cursor/legacy-default-redirect-7afd
branch
from
July 14, 2026 18:44
a169880 to
61aac2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problema
Browsers antigos (WebOS < Chrome 72) não conseguiam carregar a app Next.js moderna. O redirect anterior tentava detectar o browser depois de carregar o bundle pesado — tarde demais.
Solução
Estratégia de carregamento invertida
middleware.ts): browsers sem suporte moderno são redirecionados para/legacyantes de renderizar rotas do dashboard./legacy: script inline detecta browsers modernos e redireciona para a rota original comforceModern=1.Funcionalidades replicadas no legacy
/api/watch-progress(com fallback localStorage)/api/tmdb/configda app moderna)Parâmetros de URL
forceModern=1forceLegacy=1redirect=/caminhoComo testar
Web0Se Chrome/53 → deve abrir/legacy/legacy→ redirect automático para/dashboard?forceModern=1