Skip to content
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

[Vue] The idea of ​​making RenderController are reactive #2160

Open
wants to merge 5 commits into
base: 2.x
Choose a base branch
from

Conversation

7-zete-7
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
Issues Fix #...
License MIT

The idea is to create a bridge between the reactivity of Stimulus values ​​and the reactivity of Vue.js properties.

This would allow to influence the properties of a Vue.js component from the outside without implementing an additional Stimulus controller for this.

Changes to the properties passed to the Vue.js component inside the component would also reflect their change in the Stimulus values.

I have already implemented something similar in some projects. It would be very convenient if this worked out of the box and was useful to someone else.

@carsonbot carsonbot added Feature New Feature Vue Status: Needs Review Needs to be reviewed labels Sep 12, 2024
@7-zete-7 7-zete-7 force-pushed the patch-2 branch 5 times, most recently from bd4b700 to 3d15adf Compare September 12, 2024 22:58
Copy link
Member

@smnandre smnandre left a comment

Choose a reason for hiding this comment

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

I'm not the target user here, so i'll wait opinion of the others :)

Could you maybe add a couple of tests ... and maybe add this to the documentation with a short description + example ?

Thank you for sharing and contributing :)

@7-zete-7
Copy link
Contributor Author

Added some tests to make sure it really works.

Fixed the non-working mechanism.

@7-zete-7 7-zete-7 force-pushed the patch-2 branch 2 times, most recently from fdec785 to 8c28924 Compare September 28, 2024 20:00
Comment on lines +223 to +235
.. code-block:: javascript

// update likes component props
document.getElementById('likes-component').dataset.vuePropsValue = JSON.stringify({
likes: newLikesCount,
alreadyLike: isAlreadyLike,
});

.. code-block:: javascript

// get likes component actual props
const { likes, alreadyLike } = JSON.parse(document.getElementById('likes-component').dataset.vuePropsValue);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to make examples untied from other components. It is more logical, of course, to use Stimulus controllers to perform actions with parameters.

Kocal added a commit that referenced this pull request Nov 3, 2024
…(Kocal)

This PR was squashed before being merged into the 2.x branch.

Discussion
----------

Add CI workflow to compute diff between files dist files

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

## 🚨 Before merging, we should drop the commit that modify files (in order to generate the diff table)

<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - For new features, provide some code snippets to help understand usage.
 - Features and deprecations must be submitted against branch main.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

This PR is purely internal, and aims to display the `assets/dist/*.{js,css}` files diff between `2.x` and a pull-request. Similar to https://github.com/marketplace/actions/pkg-size-action, but fully internal.

I wanted a tool that display dist files size diff for each pull-request, because I was a bit afraid of changes done in #2160.

When a PR is opened, it check dist files between the base branch (`2.x`) and the pull request, and it create a GitHub comment. The comment is created by https://github.com/marocchino/sticky-pull-request-comment, and is automatically updated depending of the check state.
If any diff between dist files, then a table is displayed, with a line per file. It shows the  original size and compressed (gzip and brotli) sizes, and also a difference in %.

## States

_Currently not working on this repository, but you can see them on https://github.com/Kocal/symfony-ux/pull/1_

###
<img width="931" alt="Capture d’écran 2024-10-13 à 11 45 10" src="https://github.com/user-attachments/assets/288523cc-f8fa-48a7-a1e1-08174403b54d">
When opening a PR

### When an issue happened
<img width="914" alt="Capture d’écran 2024-10-13 à 11 45 19" src="https://github.com/user-attachments/assets/ae0dae2a-1998-498c-935f-e5d42f78889e">

### When there is no difference between base and PR
<img width="949" alt="Capture d’écran 2024-10-13 à 11 25 31" src="https://github.com/user-attachments/assets/0a7a56d8-1183-4341-99f6-ca386f552298">

### When there is difference between base and PR
<img width="913" alt="image" src="https://github.com/user-attachments/assets/9a5ccaf0-96cf-4189-9bc3-2e35157db70a">

Commits
-------

c6d4db6 Add CI workflow to compute diff between files dist files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Status: Needs Review Needs to be reviewed Vue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants