Skip to content

Commit

Permalink
Update doc with the new import filter
Browse files Browse the repository at this point in the history
  • Loading branch information
francoispluchino committed Oct 15, 2014
1 parent fca1f3a commit bf491ad
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ This allows you to manage asset dependencies in a PHP based project very easily.

- Works with native management system versions of VCS repository of composer
- Works with public and private VCS repositories
- Lazy load asset package files in VCS repositories to improve performance
- Lazy loader of asset package definitions to improve performance
- Import filter with the dependencies of the root package and the installed packages, for increased dramatically the performance for the update
- Automatically get and create an Asset VCS repository defined in:
- [NPM Registry](https://www.npmjs.org)
- [Bower Registry](http://bower.io/search)
Expand Down
23 changes: 23 additions & 0 deletions Resources/doc/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,29 @@ The plugin uses the system of VCS repository, and this can significantly slow th
retrieving of the definitions of packages. Fortunately, a caching system avoids to
download every time all versions.

With the version `>1.0.0-beta3` of the plugin, a new import filter lets you import only
package definitions greater than or equal to the installed versions. In this way, the
performances are dramatically improved.

Composer throws an exception stating that the version does not exist
--------------------------------------------------------------------

If Composer throws an exception stating that the version does not exist, whereas the
version exists, but it isn't imported: is that this new package version is lesser than
the installed version.

Of course, 3 solutions can work around the problem:

1. delete the `vendor` directory, do the `update`
2. disable temporarily the import filter in the `extra` section
3. add the dependency in the root Composer package with the required version (the version
not found), do the `update`, and remove the dependency in the root Composer package

> The solution 1 is the easiest and fastest.
See the documentation: [Disable the import filter using the installed packages]
(index.md#disable-the-import-filter-using-the-installed-packages)

How to reduce the number of requests for getting the package definitions?
-------------------------------------------------------------------------

Expand Down
26 changes: 26 additions & 0 deletions Resources/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,32 @@ optimization cannot be performed with the sub dependencies, you can add this ass
directly to the root Composer package, in the same way that if you wanted to use a
well-defined version of this dependency.

### Disable the import filter using the installed packages

By default, and for dramatically optimize performance for the `update`, the plugin filters the
imports of definitions packages. In addition to filter with the dependencies in the root
Composer package, the plugin filters the imports of packages definitions with the previous
versions of the packages installed.

However it may happen that Composer throws an exception, indicating that it can not find a
compatible version. This happens if a dependency uses a new version lower than the installed
version.

Of course, several solutions can work around the problem (see the [FAQs]
(faqs.md#composer-throws-an-exception-stating-that-the-version-does-not-exist)), but the
solution below may be used in another use case.

You can disable the import filter using the versions of installed packages with the option
`extra.asset-optimize-with-installed-packages` in the root Composer package:

```json
{
"extra": {
"asset-optimize-with-installed-packages": false
}
}
```

### Define a custom directory for the assets installation

By default, the plugin will install all the assets in the directory
Expand Down

0 comments on commit bf491ad

Please sign in to comment.