-
Notifications
You must be signed in to change notification settings - Fork 918
Documentation for deprecated options #1309
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
Comments
That's an interesting use case and TBH I never thought about this when designing v15. There are two aspects of the problem:
|
Hey Evan, thank you for replying. My knowledge of Webpack and vue-loader internals is limited so please bear with me. I agree with point number one. For point number two, if we cannot rely on Webpack's capabilities, then I wonder if we are looking at bringing back If we decide that adding an option compromises design decisions, or that we have to wait for a possible upstream change, I can solve my problem by moving all of my translation call sites to computed properties. Some of them have to be there anyways for binding within HTML attributes or using Again, thanks a lot for your attention on this. I'm willing to contribute a PR depending on what we decide to do. |
Submitted a PR, as linked above. I went the route of adding an option called |
I didn't realize it that postLoaders & preLoaders & loaders have been Deprecated... Yet, in spite of this, #1328 is a good way to make this right. I would be glad if it is merged. |
@zgayjjf You're welcome! I think the idea of leveraging standard Webpack Rules to post process explicit content types is a good design goal. It actually increased consistency, until we found this edge case on the render functions. Hopefully we can one day remove this option. |
@yyx990803 I just opened a merge request with an alternative solution for this issue without bringing the |
What problem does this feature solve?
My issue doesn't fit neatly within either Bug Report or Feature Request -- it's likely closest to Feature Request as I am requesting more information in the documentation. Please see the Proposed API section for my proposed resolution to this matter.
It doesn't seem to be clear from the migration documentation how we are supposed to migrate usage of
postLoaders
to a Webpack Module Rule, specifically for the default template SFC block. In Vue Loader 14, we were able to assign a Webpack loader to thehtml
property ofpostLoaders
to obtain access to the emitted render function. The documentation does indicate how to process a new type of template language (pug), but not how to work with the render function that is emitted from a default template block.In my case, I parse the emitted render function with an AST to extract parameters of specific function calls instead of statically parsing file contents using gettext. I have attempted to load the output from a template block in a number of different ways, referring to the Webpack documentation as well as the Vue Loader documentation. My loader is able to parse the
script
block but not the render function emitted from thetemplate
. Should we be targetingtest
with/\.html$/
, or/\.vue$/
? Do we need to use a resourceQuery? Do we need to useenforce: 'post'
? Do we need to add a new language extension to every template block? There are a lot of variables in this that the standard Webpack documentation cannot address easily. I suppose this is one of the challenges of being coupled to Webpack -- their documentation needs to be complemented.I seem to have the most success with this rule:
Though it seems bare:
Component template for reference:
What does the proposed API look like?
If there is an obvious reason for not being able to parse the template block's render function, I can create a PR to call it out in the docs right away. If there is not an obvious reason, I will spend some time creating a reproduction repository and file a bug report so we can investigate further and then add our findings (examples and explanations) to the docs.
The text was updated successfully, but these errors were encountered: