Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Dynamic bundle assets #31975

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
Jul 9, 2019
Merged

Dynamic bundle assets #31975

merged 1 commit into from
Jul 9, 2019

Conversation

garak
Copy link
Contributor

@garak garak commented Jun 10, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? no (new method in interface as annotation)
Deprecations? no
Tests pass? yes
Fixed tickets #29213
License MIT
Doc PR none (yet)

Everything is explained in linked issue

@derrabus
Copy link
Member

This PR should target the 4.4 branch. If you only add a @method annotation to the BundleInterface instead of the real method, it's not a BC break anymore.

@garak
Copy link
Contributor Author

garak commented Jun 11, 2019

This PR should target the 4.4 branch. If you only add a @method annotation to the BundleInterface instead of the real method, it's not a BC break anymore.

So, should I close this PR and open another one on 4.4?

@fabpot
Copy link
Member

fabpot commented Jun 20, 2019

@garak No, you change the target of this PR without creating a new one.

@garak garak changed the base branch from master to 4.4 June 20, 2019 06:50
@garak
Copy link
Contributor Author

garak commented Jun 20, 2019

@fabpot I just tried to change target to 4.4. and a bunch of stuff popped up.
Maybe a new PR is a better option... unless you can suggest a way to get rid of such mess
Thanks

@fabpot
Copy link
Member

fabpot commented Jun 20, 2019

@garak rebase your PR locally on 4.4 and push again, that should resolve the mess.

@garak garak force-pushed the dynamic-bundle-assets branch from 535008f to 33ec2d8 Compare June 20, 2019 13:08
@garak
Copy link
Contributor Author

garak commented Jun 20, 2019

I rebased upon 4.4.
I followed suggestion from @derrabus and replaced actual method with an annotation inside interface.
I also updated initial PR comment.

Hope everything is fine

@garak
Copy link
Contributor Author

garak commented Jun 29, 2019

I still see "Status: Needs Work" label. Should I do something else?

@garak
Copy link
Contributor Author

garak commented Jul 8, 2019

Friendly reminder: did needed work, do I need to do some more?

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

Having some tests for this new feature would be nice as well.

@garak
Copy link
Contributor Author

garak commented Jul 8, 2019

I addressed all notes from @fabpot, I guess. Some portions of code are not shown as modified, but they are, actually.
I also added a small expectation in tests, I couldn't find any direct tests of AssetsInstallCommand. Failures in CI are unrelated

@fabpot fabpot force-pushed the dynamic-bundle-assets branch from f99e81d to c16fcc9 Compare July 9, 2019 06:13
@fabpot
Copy link
Member

fabpot commented Jul 9, 2019

Thank you @garak.

@fabpot fabpot merged commit c16fcc9 into symfony:4.4 Jul 9, 2019
fabpot added a commit that referenced this pull request Jul 9, 2019
This PR was squashed before being merged into the 4.4 branch (closes #31975).

Discussion
----------

Dynamic bundle assets

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (new method in interface as annotation)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29213
| License       | MIT
| Doc PR        | none (yet)

Everything is explained in linked issue

Commits
-------

c16fcc9 Dynamic bundle assets
@garak garak deleted the dynamic-bundle-assets branch July 9, 2019 06:38
fabpot added a commit that referenced this pull request Jul 12, 2019
…ereguiluz)

This PR was squashed before being merged into the 4.4 branch (closes #32452).

Discussion
----------

[Bundles] Rename getPublicPath() as getPublicDir()

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -
| License       | MIT
| Doc PR        | I'll add this if approved

While documenting #31975 (see symfony/symfony-docs#11930) I realized that the `getPublicPath()` method name is not consistent with the rest of Symfony.

In Symfony, "path" is usually associated to routes and we use "dir" for things similar to this:

* `getCacheDir()` and `getLogdir()` to override Symfony structure (https://symfony.com/doc/current/configuration/override_dir_structure.html)
* `binDir`, `configDir`, `srcDir`, `varDir`, `publicDir` in Symfony Flex recipes (https://github.com/symfony/recipes) to override the dir structure

So, this PR proposes to rename `getPublicPath()` as `getPublicDir()`

Commits
-------

4ab2f99 [Bundles] Rename getPublicPath() as getPublicDir()
@@ -135,6 +135,11 @@ public function registerCommands(Application $application)
{
}

public function getPublicPath(): string
{
return 'Resources/public';
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO that should return the absolute dir to be consistent with getLogDir etc,

return $this->getProjectDir().'/var/log';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Tobion here we're not in the project context, but in the bundle one. Anyway, bundle always returned such path, this is not changing anything

symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Aug 13, 2019
…on for bundle directories (yceruto)

This PR was squashed before being merged into the 4.4 branch (closes #32845).

Discussion
----------

[HttpKernel][FrameworkBundle] Add alternative convention for bundle directories

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony#32453
| License       | MIT
| Doc PR        | TODO

We already know that bundles must be compatible with many Symfony's versions, so it is very likely that current bundles won't be able to use this feature soon, unless they create symbolic links to support both structures.

The point is that this is already happening, so in the future when our bundles stop to support <=4.3 then you'll be sure to change the current directory structure.

We have recently added the `getPublicDir()` method in symfony/symfony#31975, here I'm removing it in favor of hardcoding a new convention.

I've added some functional tests in which I've changed everything to this structure:
```
-- ModernBundle
   |-- config/
   |-- public/
   |-- src/
       |-- ModernBundle.php
   |-- templates/
   |-- translations/
```
WDYT?

Commits
-------

6996e1cbe2 [HttpKernel][FrameworkBundle] Add alternative convention for bundle directories
nicolas-grekas added a commit that referenced this pull request Aug 13, 2019
…on for bundle directories (yceruto)

This PR was squashed before being merged into the 4.4 branch (closes #32845).

Discussion
----------

[HttpKernel][FrameworkBundle] Add alternative convention for bundle directories

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32453
| License       | MIT
| Doc PR        | TODO

We already know that bundles must be compatible with many Symfony's versions, so it is very likely that current bundles won't be able to use this feature soon, unless they create symbolic links to support both structures.

The point is that this is already happening, so in the future when our bundles stop to support <=4.3 then you'll be sure to change the current directory structure.

We have recently added the `getPublicDir()` method in #31975, here I'm removing it in favor of hardcoding a new convention.

I've added some functional tests in which I've changed everything to this structure:
```
-- ModernBundle
   |-- config/
   |-- public/
   |-- src/
       |-- ModernBundle.php
   |-- templates/
   |-- translations/
```
WDYT?

Commits
-------

6996e1c [HttpKernel][FrameworkBundle] Add alternative convention for bundle directories
symfony-splitter pushed a commit to symfony/twig-bundle that referenced this pull request Aug 13, 2019
…on for bundle directories (yceruto)

This PR was squashed before being merged into the 4.4 branch (closes #32845).

Discussion
----------

[HttpKernel][FrameworkBundle] Add alternative convention for bundle directories

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony#32453
| License       | MIT
| Doc PR        | TODO

We already know that bundles must be compatible with many Symfony's versions, so it is very likely that current bundles won't be able to use this feature soon, unless they create symbolic links to support both structures.

The point is that this is already happening, so in the future when our bundles stop to support <=4.3 then you'll be sure to change the current directory structure.

We have recently added the `getPublicDir()` method in symfony/symfony#31975, here I'm removing it in favor of hardcoding a new convention.

I've added some functional tests in which I've changed everything to this structure:
```
-- ModernBundle
   |-- config/
   |-- public/
   |-- src/
       |-- ModernBundle.php
   |-- templates/
   |-- translations/
```
WDYT?

Commits
-------

6996e1cbe2 [HttpKernel][FrameworkBundle] Add alternative convention for bundle directories
symfony-splitter pushed a commit to symfony/doctrine-bridge that referenced this pull request Aug 13, 2019
…on for bundle directories (yceruto)

This PR was squashed before being merged into the 4.4 branch (closes #32845).

Discussion
----------

[HttpKernel][FrameworkBundle] Add alternative convention for bundle directories

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony#32453
| License       | MIT
| Doc PR        | TODO

We already know that bundles must be compatible with many Symfony's versions, so it is very likely that current bundles won't be able to use this feature soon, unless they create symbolic links to support both structures.

The point is that this is already happening, so in the future when our bundles stop to support <=4.3 then you'll be sure to change the current directory structure.

We have recently added the `getPublicDir()` method in symfony/symfony#31975, here I'm removing it in favor of hardcoding a new convention.

I've added some functional tests in which I've changed everything to this structure:
```
-- ModernBundle
   |-- config/
   |-- public/
   |-- src/
       |-- ModernBundle.php
   |-- templates/
   |-- translations/
```
WDYT?

Commits
-------

6996e1cbe2 [HttpKernel][FrameworkBundle] Add alternative convention for bundle directories
symfony-splitter pushed a commit to symfony/http-kernel that referenced this pull request Aug 13, 2019
…on for bundle directories (yceruto)

This PR was squashed before being merged into the 4.4 branch (closes #32845).

Discussion
----------

[HttpKernel][FrameworkBundle] Add alternative convention for bundle directories

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony#32453
| License       | MIT
| Doc PR        | TODO

We already know that bundles must be compatible with many Symfony's versions, so it is very likely that current bundles won't be able to use this feature soon, unless they create symbolic links to support both structures.

The point is that this is already happening, so in the future when our bundles stop to support <=4.3 then you'll be sure to change the current directory structure.

We have recently added the `getPublicDir()` method in symfony/symfony#31975, here I'm removing it in favor of hardcoding a new convention.

I've added some functional tests in which I've changed everything to this structure:
```
-- ModernBundle
   |-- config/
   |-- public/
   |-- src/
       |-- ModernBundle.php
   |-- templates/
   |-- translations/
```
WDYT?

Commits
-------

6996e1c [HttpKernel][FrameworkBundle] Add alternative convention for bundle directories
This was referenced Nov 12, 2019
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.

8 participants