Skip to content

[Icons] Prepare lock / warmup optimization #2351

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
Nov 9, 2024

Conversation

smnandre
Copy link
Member

@smnandre smnandre commented Nov 7, 2024

Method needed for both

  • lock/warmup optimization
  • sprite generation
  • search performances

@carsonbot carsonbot added Icons Status: Needs Review Needs to be reviewed labels Nov 7, 2024
@smnandre smnandre requested a review from Kocal November 7, 2024 21:15
@smnandre smnandre requested a review from kbond November 7, 2024 21:16
smnandre added a commit to smnandre/ux that referenced this pull request Nov 8, 2024
First usage of symfony#2351 with the import command

Next steps:
* lock
* warm-up

:)
Comment on lines 97 to 105
throw new \InvalidArgumentException('Invalid icon names.');
}

// 500 chars max
// 42 chars: https://api.iconify.design/mdi.json?icons=
if (450 < \strlen($queryString)) {
throw new \InvalidArgumentException('The query string is too long.');
Copy link
Member

Choose a reason for hiding this comment

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

Please use dedicated exception classes

Copy link
Member

Choose a reason for hiding this comment

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

Is the plan to catch this? (I typically only add named exceptions if this is the case - or it's realistic an end-user would want to catch)

Copy link
Member

@Kocal Kocal Nov 8, 2024

Choose a reason for hiding this comment

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

Nah I don't think so, but I like to have dedicated exceptions and also a base exception class per package (like they do on Symfony components)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not on every component to be far... ;)

Yet I kinda agree to use custom exception but this should be done in a dedicated PR i think, carefully selecting the one we want to "migrate" and the one we do not.

To explain myself here, this is internal and "should never" happen.

But as we all know what "should never" means... i get your point.

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Nov 8, 2024
@carsonbot carsonbot added Status: Needs Review Needs to be reviewed and removed Status: Reviewed Has been reviewed by a maintainer labels Nov 8, 2024
@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Nov 8, 2024
@smnandre smnandre merged commit 497a140 into symfony:2.x Nov 9, 2024
59 checks passed
smnandre added a commit to smnandre/ux that referenced this pull request Nov 9, 2024
First usage of symfony#2351 with the import command

Next steps:
* lock
* warm-up

:)
smnandre added a commit that referenced this pull request Nov 10, 2024
This PR was squashed before being merged into the 2.x branch.

Discussion
----------

[Icons] Fetch icons in batch in Import command

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

First usage of #2351 with the import command

---

**Update:**

- add icons counts (imported / total)
- handle same-prefix icons per batch
- improve visual feedback

<img width="878" alt="Capture d’écran 2024-11-09 à 19 26 16" src="https://github.com/user-attachments/assets/fc6c377e-ba40-43f3-b62a-0070ba14125b">

---

Next ones:
* lock
* warm-up

Commits
-------

88d24e0 [Icons] Fetch icons in batch in Import command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Icons Performance Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants