Skip to content

Conversation

@weaverryan
Copy link
Member

Q A
License MIT
Doc issue/PR symfony/ux#330

Hi!

This adds a recipe for the proposed new ux-autocomplete package... the only needed thing is the route import.

Cheers!

weaverryan added a commit to symfony/ux that referenced this pull request Jun 9, 2022
… (weaverryan)

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

Discussion
----------

[Autocompleter] New Ajax-powered, autocomplete component

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| Tickets       | none
| License       | MIT

Hi! A new component! One I've wanted for a LONG time. In short, it creates things that look like this, where the autocomplete search is backed by Ajax.

![ux-autocomplete-animation](https://user-images.githubusercontent.com/121003/172226699-9ec8f016-6d46-4da0-a5fa-d626f37612f3.gif)

Big thanks to EasyAdmin, whose AssociationField heavily inspired this.

* [ ] We could possibly avoid the requirement of creating a separate class for Ajax autocomplete by using signed URLs. However, this would only work for "simpler" fields - e.g. if you had a custom `query_builder` (or perhaps other options that we might not want to include in the URL, like `security`), then you would still be required to have the extra class. It's something to explore.

Cheers!

Recipe: symfony/recipes#1094

Commits
-------

1228e99 [Autocompleter] New Ajax-powered, autocomplete component
@weaverryan weaverryan changed the title [WIP][symfony/ux-autocomplete] Adding UX autocomplete recipe [symfony/ux-autocomplete] Adding UX autocomplete recipe Jun 13, 2022
@weaverryan weaverryan force-pushed the autocomplete-recipe branch from 43b65b8 to 34455a6 Compare June 13, 2022 19:21
@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) June 13, 2022 19:21
@github-actions
Copy link

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1094/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1094/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/ux-autocomplete:^2.2'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

@weaverryan
Copy link
Member Author

This is ready. The QA fails because the CI ALWAYS tests with PHP 7.4... and this is a PHP 8 package only. I'm not sure what we should do about that.

@symfony-recipes-bot symfony-recipes-bot merged commit 9bb9b94 into symfony:main Jun 14, 2022
@weaverryan weaverryan deleted the autocomplete-recipe branch June 14, 2022 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants