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

Maybe avoid generating endpoints next to routes #50

Closed
pixelmund opened this issue Feb 25, 2022 · 3 comments · Fixed by #54
Closed

Maybe avoid generating endpoints next to routes #50

pixelmund opened this issue Feb 25, 2022 · 3 comments · Fixed by #54
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@pixelmund
Copy link
Owner

pixelmund commented Feb 25, 2022

Describe the bug

The situation is a bit tricky, we're currently using/generating SvelteKit Endpoints next to the files, but this can quickly sum up to a lot of files. I don't know if there is a way to avoid generating them while still using the functionality. This should probably belong to Kit, but i'm not sure what a solution in Kit would look like.

  • I've already tried using different techniques with the handle hook, but all seem wrong.
  • I've also experimented and looked into if we could solve this with our vite plugin.
  • Maybe allowing multiple route paths in Kit would help with this issue?

We could also leave it the way it is currently.

Your Example Website or App

Steps to Reproduce the Bug or Issue

Expected behavior

We shouldn't create the endpoints visible to the user.

Screenshots or Videos

Platform

Additional context

@pixelmund pixelmund added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Feb 25, 2022
@pixelmund pixelmund pinned this issue Feb 25, 2022
@Acmion
Copy link

Acmion commented Feb 26, 2022

Yeah, I have also thought about this issue.

I hid the "unwanted" files in VS Code, however, this is not generalizable to all cases. Additionally, this is also relatively prone to errors, especially if working in teams where a member may edit a generated file and thus causing problems in the long run.

@pixelmund
Copy link
Owner Author

A temporary solution is to edit the vscode settings or create a /.vscode/settings.json file with the following content:

{
    "files.exclude": {
        "src/routes/**/*.ts": true,
        "src/routes/**/*.js": true,
        "src/routes/api/**/*.js": false,
        "src/routes/api/**/*.ts": false
    }
}

The api folder would contain anything that you wan't to handle with Standalone SvelteKit and yes @Acmion this is unfortunate.

@wobsoriano
Copy link

Remix added support for Vue, and now have an open PR for Svelte fyi

brophdawg11/remix-routers#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants