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

V2 issue: AppConfig should not have v2 future flags #7253

Closed
1 task done
kentcdodds opened this issue Aug 24, 2023 · 6 comments · Fixed by #7261
Closed
1 task done

V2 issue: AppConfig should not have v2 future flags #7253

kentcdodds opened this issue Aug 24, 2023 · 6 comments · Fixed by #7261
Assignees
Labels
bug Something isn't working feat:typescript v2 Issues related to v2 apis

Comments

@kentcdodds
Copy link
Member

What version of Remix are you using?

0.0.0-nightly-49e8da1-20230823

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

TS Playground:

import { type AppConfig } from "@remix-run/dev"; // types: 0.0.0-nightly-49e8da1-20230823

export default {
	cacheDirectory: './node_modules/.cache/remix',
	ignoredRouteFiles: ['**/*'],
	serverModuleFormat: 'esm',
	serverPlatform: 'node',
	tailwind: true,
	postcss: true,
	watchPaths: ['./tailwind.config.ts'],
	future: {
    // these should not be allowed:
		v2_headers: true,
		v2_meta: true,
		v2_errorBoundary: true,
		v2_normalizeFormMethod: true,
		v2_routeConvention: true,
		v2_dev: true,
	},
} satisfies AppConfig

Expected Behavior

v2 future flags should not be allowed with nightly (v2)

Actual Behavior

v2 future flags are allowed in nightly (v2)

@MichaelDeBoey MichaelDeBoey added feat:typescript v2 Issues related to v2 apis labels Aug 25, 2023
@MichaelDeBoey MichaelDeBoey added this to v2 Aug 25, 2023
@MichaelDeBoey MichaelDeBoey moved this to Backlog in v2 Aug 25, 2023
@brophdawg11 brophdawg11 self-assigned this Aug 25, 2023
@brophdawg11
Copy link
Contributor

Huh, interesting. That type is Partial<FutureConfig> and FutureConfig is empty, but I guess TS allows other props since they satisfy the base value (https://www.typescriptlang.org/docs/handbook/2/objects.html#excess-property-checks).

I guess we can union that with a never: https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgGIFczqhAwgexBmAHNkBvAKAEgA3AZgH0o4ATVCOLHALmQCN8+ADacQlAL6VKoSLEQoAggAdlBIqQqVkO5DEzYIAfj4AFOFDDA4wgDwZueQsRIA+ZADIt1agG1lUPjKAHJwALYQfADOYFCgJAC6fCAQtNAA3DQSmVKUEAAeyviWyKwQ8OjCYN76jnxUPgzMbBxchnyx6BAANDR0AEyMAO5gABYQCADWHVBdvdQSvRLIUVzAUcQQUcgqas6klEA

@kentcdodds
Copy link
Member Author

That sounds good. I'm just sure many people will upgrade and they'll have to run the server to realize they still need to remove the old feature flags, so this is probably worth it.

@brophdawg11
Copy link
Contributor

Yeah - since the config is not TS by default we did add some build time warnings for those in https://github.com/remix-run/remix/blob/dev/packages/remix-dev/config.ts#L566. But if folks are using TS like this it would be nice to let them know 👍

@kentcdodds
Copy link
Member Author

Agreed, those warnings are definitely nice 👍 Thanks!

@brophdawg11
Copy link
Contributor

Fixed by #7261 and will be included in Remix v2

@brophdawg11 brophdawg11 added bug Something isn't working awaiting release This issue has been fixed and will be released soon and removed bug:unverified labels Aug 28, 2023
@MichaelDeBoey MichaelDeBoey moved this from PR to Merged in v2 Aug 28, 2023
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 2.0.0-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feat:typescript v2 Issues related to v2 apis
Projects
No open projects
Status: Merged
Development

Successfully merging a pull request may close this issue.

3 participants