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

fix(remix-dev): relativize route modules to make builds deterministic #2027

Merged
merged 1 commit into from
Jul 14, 2022

Commits on Jul 8, 2022

  1. fix(remix-dev): relativize route modules to make builds deterministic

    Fixes remix-run#2024
    
    If virtual modules have non-deterministic paths or content (e.g. due to
    importing from other absolute paths), the input is technically different,
    and deterministic build output is not guaranteed.
    
    Depending on how you build/deploy (e.g. if you need to build and deploy
    your server separately from your browser build), this can result in a broken
    app, since the server and browser manifests may differ (i.e. due to different
    fingerprints). By using relative paths for route modules, we can ensure the
    same result no matter the absolute path.
    
    Possibly worth pointing out that this fix also affects file path comments in
    the server build, e.g. you'll now see stuff like:
     // app/root.tsx
    instead of:
     // /absolute/path/on/the/build/machine/to/app/root.tsx
    
    Testing notes:
     1. Added integration test
     2. Verified manually, i.e.
        1. Create two remix projects (via npx create-remix@latest)
        2. `npm run build` them both
        3. `diff -r project1/build project2/build` has no differences
        4. `diff -r project1/public/build project2/public/build` has no differences
        5. `dev` and `start` still work as per usual
    jenseng committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    1c6f49e View commit details
    Browse the repository at this point in the history