-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Alternative to Lazy*
prefix
#180
Comments
/cc @nuxt/framework ideas welcome |
+1 for async for aligning to Vue async component |
@clarkdo You mean |
Yes |
Maybe I’m misunderstand async components, but isn’t there lots of scenarios where a component can be used in different places, sometimes async and sometimes not? So by using the filename as the way to detect if it’s async or not seems like the wrong approach? Or is this the only way? The Vue guide also recommend tightly coupled components to have related names, like “CarsList” and “CarsListItem”, so by forcing “Async” at the start of the component you’ll be loosing that coupling. I just suspect people hate being forced to have any word in their component file name, no matter what you pick. That’s why I prefer the modifier Name.async.vue, feel more “nuxt” (like the way plugin file names can have client or server in them). |
@drewbaker That's true and you do don't need to prefix your component file name with either Lazy or Async 🙈 It should be called |
Oh Ok I’m that case AsyncFoo seems great! |
@pi0 I come across this issue since I just found out Nuxt having this as default now on new projects setup. And looking in the doc I too thought I have to rename my component |
As mentioned by @dmx374 (#83), using
Lazy
prefix might be confusing in situations when the component name is prefixed with Lazy for its purpose (LazyLoad, LazySpin, etc).We cannot use directives since it forces to use a loader and parsing overhead but we can introduce another alias while keeping backward compatibility with
Lazy{name}
. Some options:Async{Name}
/async-{name}
{Name}.lazy
/{name}.lazy
(suggested by @drewbaker){Name}.async
/{name}.async
The text was updated successfully, but these errors were encountered: