-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Preparation for #8452: 'jquery' package extraction #13839
Conversation
Can't we just use jQuery from CDN by default? |
It makes no difference. PHP framework should not be bound to any JavaScript framework. |
It fixes main issue - you don't need asset plugin anymore and you can install Yii without any frontend dependencies. I agree that framework-agnostic approach is generally good thing, but it looks like overkill and unnecessary complication. If I want write extension which extends |
Following your arguments, should not we bind Yii2 to Twitter Bootstrap as well? Why keep
It depends on what you want to do: you may use I am fixing the issues, which are opened and which core team has agreed to be fixed. If you wish to debate on necessity of such changes use the related issues for that: #8452, #11792, #10557, #8709, #9525. |
This PR fixes #12588 |
Please, be constructive...
My extension is not related to JS at all so I may use any of this class. But if I use
Did you at least read these issues before linking? They are mostly about installing frontend dependencies, which may be solved by using CDN fallback. Some of them even proposing using CDN for jQuery. |
Hmm... @rob006 has a point about having two separate GridViews... |
You should use `yii\jquery\*` package classes instead, to make old code function as before. E.g. use `yii\jquery\ActiveForm` instead | ||
of `yii\widgets\ActiveForm`, `yii\jquery\GridView` instead of `yii\grid\GridView` and so on. | ||
|
||
* Assets `yii\web\JqueryAsset`, `yii\web\YiiAsset`, `yii\validators\ValidationAsset`, `yii\captcha\CaptchaAsset` have been |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning extracting Captcha in its own package.
I agree with @rob006 , I'm positive towards disentanglement of parts, but I dont like the overuse of inheritance in the framework. This is not exactly favoring 'composition' over inheritance and limits flexibility. |
@dynasource any ideas on how to do it better? |
like I said, encapsulate the logic in dependencies instead of inheritance. All these JS parts deserve their own classes and should not pollute the inheritance tree. |
this is also an example of GridView |
I understand the theory. I was asking about its practical application for this particular case. |
I like the idea. It could be configured via container as well... |
Why? I've successfully extracted https://github.com/yiisoft/yii2-maskedinput without doing a subsplit... |
At yii2-captcha but it should be a behavior or a separate class. Not a widget inherited from Captcha. |
I think it would make perfect sense. |
Subsplit is better as it will preserve the git history.
So it will, but my question still stands:
If it will be located at |
About jQuery-related part of CAPTCHA, I prefer to rewrite JS part of it without using jQuery. yii.captcha.js isn't too complicated to do it. |
My suggestion. yii2-widgets (base widigets without js or css dependencies) and yii2-jquery must be separated from core framework |
@leandrogehlen separating widgets completely isn't the goal of this pull request. |
Ok, then , i think that the folder |
Solution has been refactored:
|
Looks good after quick glance on it. Need to check it in depth though. |
At the present state I do not have time for this. I need to finish #14701 and underlying tasks, which depends on it. Otherwise, it will likely end in conflicts anyway. Most likely, I will re-create this PR from scratch afterwards. Since, at the present state, core team has no interest on reviewing this or attend to the underlying issue, it is not in hurry. Even if I merge this changeset, it will solves nothing until the |
100% agreed! @samdark Could you create those repos for 2.1 ( |
PJAX is to be removed so I haven't created a repo for it. |
Migrated to #14865 |
'jquery' package has been extracted as preparation for
yii2-jquery
repo extraction, which will allow to create requirements free version of Yii2 and make composer-asset-plugin installation to be optional.