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

compiler-sfc: 解析Scss时实现处未支持异步的情况,前面的API调用都已经支持了异步,但是实现的时候却只处理了同步的情况, 是否考虑在实现处支持promise的情况 #5231

Closed
jeryqwq opened this issue Jan 9, 2022 · 2 comments

Comments

@jeryqwq
Copy link

jeryqwq commented Jan 9, 2022

What problem does this feature solve?

https://github.com/vuejs/vue-next/blob/eb721d49c004abf5eff0a4e7da71bad904aa6bac/packages/compiler-sfc/src/stylePreprocessors.ts?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L36

最近在做一些关于移植到浏览器内支持vue-sfc-loader时,浏览器内的scss.js 仅支持异步函数解析,处理到这块会出现问题,是否要增加代码适配scss异步的情况

What does the proposed API look like?

if(options.isAsync){
    result = await new Promise((resolve, reject) => {
    nodeSass.render(finalOptions, (err, res) => { // node-scss 官方的语法, 浏览器内也只要实现一遍render方法即可
      resolve(res)
    })
  })
} else{
  result =  nodeSass.renderSync(finalOptions)
}
@jeryqwq jeryqwq changed the title 解析Scss时实现处未支持异步的情况,前面的API调用都已经支持了异步,但是实现的时候却只处理了同步的情况, 是否考虑在实现处支持promise的情况 compiler-sfc: 解析Scss时实现处未支持异步的情况,前面的API调用都已经支持了异步,但是实现的时候却只处理了同步的情况, 是否考虑在实现处支持promise的情况 Jan 9, 2022
@jeryqwq jeryqwq closed this as completed Jan 9, 2022
@jeryqwq jeryqwq reopened this Jan 9, 2022
@posva
Copy link
Member

posva commented Jan 11, 2022

Hello, make sure to always provide a reproduction that follows the instructions at https://new-issue.vuejs.org/?repo=vuejs/vue-next#why-repro.

Open a new issue with a reproduction that follows those instructions if you manage to create a boiled down reproduction.

@jeryqwq
Copy link
Author

jeryqwq commented Sep 6, 2023

@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants