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

Sync preprocess #291

Closed
wants to merge 2 commits into from
Closed

Conversation

ehrencrona
Copy link

@ehrencrona ehrencrona commented Dec 11, 2020

This is a proposal for allowing synchronous preprocessing in order to solve sveltejs/kit#19 . It allows preprocessors to export synchronous versions of their processing functions. This allows the preprocessor to be used with e.g. require.extensions.

It goes together with sveltejs/svelte#5770

It's still a draft; tests are missing and the code could be refactored further. I'd like feedback as to whether this is a good idea before proceeding.

Getting TypeScript to play ball with functions that are sometimes sync and sometimes async was a bit messy, which IMO is the main argument against this solution.

@kaisermann
Copy link
Member

kaisermann commented Dec 14, 2020

Hey @ehrencrona 👋 First of all, thanks for the effort in trying to resolve this async problem. However, I'm not convinced that this is something that should be handled on our side. The current PR adds a fair bit of complexity and is not an exactly scalable solution to the problem. IMO using a deasync-like lib or starting a new node process, albeit not the ideal solution, is a better way forward for now.

@ehrencrona
Copy link
Author

Closing due to lacking traction.

@ehrencrona ehrencrona closed this Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants