Skip to content

Add @a2lix/symfony-collection solution #9614

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

Merged
merged 1 commit into from
Sep 23, 2019
Merged

Conversation

webda2l
Copy link
Contributor

@webda2l webda2l commented Apr 17, 2018

Hello,

I wrote a blog post earlier this month about this package: https://a2lix.fr/2018/04/05/manage-symfony-form-collection-with-vanilla-javascript.html.
IMO, as there are Symfony best practices, we should do a bit of Javascript good practices and start discouraging the use of jQuery in the documentation right now.

I thought about updating the different parts of jQuery code of this form_collections.rst to a modern JS code, but it doesn't satisfy me because to do good things, it will increase number of lines of JS.
And, IMO, it's better to push people to use an external JS solution (or create symfony JS based solution) instead of explain quickly how redo a poor JS solution.

Any thoughts?

@ghost
Copy link

ghost commented Apr 19, 2018

I'm grateful that people contribute something to the community by creating packages that bring a solution for certain problems.

I do think you should change:

The package `@a2lix/symfony-collection`_ helps as well with ``collection`` form elements, 
to provide to modern browsers a simple version that do not require jQuery anymore.

to

The package `@a2lix/symfony-collection`_ also works with``collection`` form elements, 
to provide to modern browsers an improved slimmer version that do not require jQuery.

Somebody else has to check and share their opinion about this before we merge this.

@wouterj
Copy link
Member

wouterj commented May 5, 2018

Yep, I agree with the rewordings proposed by @ricknox Furthermore, for something to be seen as "the encouraged way", it should be mentioned first in the docs. So let's change the order of the two packages: First mention the new package and then mention the jQuery package like: "If you want to use jQuery, there is a jQuery extension [...]".

If you agree and have time to change this, please update this PR. Otherwise, we'll take your commit and add a new commit changing it afterwards. In any case, thanks for starting to update the docs with best practices from non-Symfony worlds!

@webda2l
Copy link
Contributor Author

webda2l commented May 9, 2018

@wouterj updated, but yes feel free to make additional changes!

@xabbuh
Copy link
Member

xabbuh commented May 18, 2018

@webda2l The changes could be applied to the 2.7 docs too, right?

Copy link
Contributor

@ndench ndench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely agree with discouraging jQuery 👍

javiereguiluz added a commit that referenced this pull request Sep 23, 2019
This PR was squashed before being merged into the 3.4 branch (closes #9614).

Discussion
----------

Add @a2lix/symfony-collection solution

Hello,

I wrote a blog post earlier this month about this package: https://a2lix.fr/2018/04/05/manage-symfony-form-collection-with-vanilla-javascript.html.
IMO, as there are Symfony best practices, we should do a bit of Javascript good practices and start discouraging the use of jQuery in the documentation right now.

I thought about updating the different parts of jQuery code of this form_collections.rst to a modern JS code, but it doesn't satisfy me because to do good things, it will increase number of lines of JS.
And, IMO, it's better to push people to use an external JS solution (or create symfony JS based solution) instead of explain quickly how redo a poor JS solution.

Any thoughts?

Commits
-------

d2b7cee Add @a2lix/symfony-collection solution
@javiereguiluz javiereguiluz merged commit d2b7cee into symfony:3.4 Sep 23, 2019
@javiereguiluz
Copy link
Member

I finally merged this. I apologize for the long delay :( Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants