vuejs / vue-loader

📦 Webpack loader for Vue.js components
MIT License
4.99k stars 914 forks source link

why ssr module registration was removed from v16 #1887

Open tcstory opened 3 years ago

tcstory commented 3 years ago

Version

16.8.1

Reproduction link

github.com

Steps to reproduce

i have no idea why the functionality was removed. it's very important for ssr rendering.

vitejs/plugin-vue and vue-loader are both plugins, why vitejs/plugin-vue has this functionality but vue-loader doesnt

What is expected?

ssr module registration should be support

What is actually happening?

ssr module registration was removed

haoqunjiang commented 3 years ago

Please be more specific. I don't understand what you mean by "ssr module registration"

tcstory commented 3 years ago

sorry.

version 15.x of vue-loader will use the following code to add the component during ssr rendering, the code is located in lib/runtime/componentNormalizer.js

// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
  context._registeredComponents.add(moduleIdentifier)
}
haoqunjiang commented 3 years ago

Oh, that was a planned but not yet implemented feature. As you can see, the SSR tests are still listed as TODOs.

Thanks for bringing this up. I'll see if I can implement it when I have time.

Contributions are also welcome.

phoenix-ru commented 2 years ago

Hi @sodatea. I've implemented critical CSS collection in https://github.com/phoenix-ru/vue-loader.

However, my solution assumes that vue-style-loader is used (as with v15). Can you verify if that's acceptable or v16 dropped vue-style-loader for a reason?

If that solution is fine, I can open a PR and polish it

BlackCubeNo99 commented 2 years ago

Oh, that was a planned but not yet implemented feature. As you can see, the SSR tests are still listed as TODOs.

Thanks for bringing this up. I'll see if I can implement it when I have time.

Contributions are also welcome.

Does anyone have a work around? @sodatea

dmitryuk commented 6 days ago

Hello, any plans?