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

Project: Metaframework adapter overhaul #217

Open
5 tasks
samuelstroschein opened this issue Sep 6, 2024 — with Linear · 9 comments
Open
5 tasks

Project: Metaframework adapter overhaul #217

samuelstroschein opened this issue Sep 6, 2024 — with Linear · 9 comments

Comments

Copy link
Member

samuelstroschein commented Sep 6, 2024

Context

Metaframeworks (SvelteKit, NextJS) lead to recurring bugs and maintenance overhead.

Proposal

Investigate what causes the metaframework complexities and simplify the architecture to reduce bugs and maintenance effort.

Potential solutions

Timeline

The project Paraglide JS 2.0 #201 comes first.

Issues

Open issues can be seen by filtering the "metaframework overhaul" label

@samuelstroschein
Copy link
Member Author

@paraglide users, your input is appreciated on how we can make the metaframework stuff sipler

@samuelstroschein
Copy link
Member Author

Re-route on sveltekit is making issues.

image

@EcksDy
Copy link

EcksDy commented Oct 4, 2024

@samuelstroschein
Came from #233 , my 2 cents:

I've re-read the docs section for exclusions.

Excluded routes will:

  • Not have any rel="alternate" links added to them
  • Not have their Paths translated
  • Not have links pointing to them translated

In my case I didnt realize my paths will be localized. For ru and he, they aren't.
Tying together asset routes, page translations, alt links and route localization on one exclude is confusing, that's for sure.
I guess that ru/he are not supported for route localization, which is good for me, considering the currently available config API I'd be a lot more frustrated if they were.

What I'm trying to achieve is:

  • have alternate links
  • translate pages
  • images/static assets should not be translated/redirected
  • routes should not be localized
  • have the project build without errors

What I think should happen by default:

  • route localization should be off
  • page translation should be on
  • alternate links should be on
  • images/assets(fonts/binaries/etc) should be excluded

@samuelstroschein
Copy link
Member Author

It's increasingly clear that metaframeworks should be adapters that extend the compiler.

  • one doc site
  • unified API (setLocale, etc)
  • simplified metaframework implementations that just emit an additional file adapter-sveltekit.{js}
    -- increases discoverability of what is going on
    -- simple, adapter in a file :)
    -- people can write their own adapter files

@gerardmarquinarubio
Copy link

  • one doc site

I come from #245 and while I have not much valuable to add I feel like any meta-framework rewrite to unify adapters should still have different documentation for different possible combinations of frameworks/choices. That could bloat that single doc site adding to visual clutter and possibly lead to unmantained docs due to the sheer amount of different pages that are available.

Just with NextJS you have 4 different combinations (pages/app router and localized routes vs other strategies) each with different setups and examples. Not even counting different Next versions that possibly break compatibility and may also need specific guides/instructions.

@samuelstroschein samuelstroschein changed the title Project: Metaframework overhaul Project: Metaframework adapter overhaul Nov 8, 2024
@Mardoxx
Copy link

Mardoxx commented Jan 5, 2025

Cookie language selection only would be fantastic (without URL rewriting). I haven't managed to get there yet with writing my own adapters (sveltekit)

Copy link
Member Author

@Mardoxx the paraglide js 2.0 beta is coming this january with elaborate docs on how to write your own adapter

Copy link
Member Author

@Mardoxx here are the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/strategy

@samuelstroschein
Copy link
Member Author

Here's what I am going to do (see the update #201 (comment)):

  • Adapters will all have the same APIs. The API is defined in Paraglide JS itself
  • The strategy becomes configurable e.g. domain routing, cookie stuff whatever

Goals:

  • make adapters unopinionated
  • increase DX by having the same API across Paraglide JS and it's adapters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants