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

Always use service id as block id #302

Merged
merged 1 commit into from
Jan 2, 2017

Conversation

core23
Copy link
Member

@core23 core23 commented Jun 10, 2016

Depends on #344

Changelog

### Changed
- The block name is automatically set via `TweakCompilerPass`

Subject

The id/name of a block is automatically set to the internal service id. This is the same mechanism like creating a admin. You can't declare the block name by yourself anymore.

@greg0ire
Copy link
Contributor

helds => holds ?

@greg0ire
Copy link
Contributor

LGTM

@soullivaneuh
Copy link
Member

You don't have to declare the block name by yourself anymore.

But can you?

BC way possible?

@soullivaneuh
Copy link
Member

BTW, I think what you did is BC, am I wrong?

@greg0ire
Copy link
Contributor

greg0ire commented Jun 10, 2016

BTW, I think what you did is BC, am I wrong?

The translations ids are changing :P

@soullivaneuh
Copy link
Member

The translations ids are changing :P

Maybe keep the old one? Or don't add .service?

@core23
Copy link
Member Author

core23 commented Jun 10, 2016

BTW, I think what you did is BC, am I wrong?

This is a BC break, because we have to change the translation keys OR the service ids. Furthermore, anybody who uses custom blocks could have new block names.

@core23
Copy link
Member Author

core23 commented Jun 10, 2016

👍 for changing the service ids
👎 for changing the translation keys

@soullivaneuh
Copy link
Member

This is a BC break, because we have to change the translation keys OR the service ids.

Please see my previous sentences.

Furthermore, anybody who uses custom blocks can have new block names.

Not sure to understand. Can you please elaborate?

👍 for changing the service ids
👎 for changing the translation keys

Well, some argument of why would be great. 😉

@core23
Copy link
Member Author

core23 commented Jun 11, 2016

The translations ids are changing

Maybe keep the old one? Or don't add .service?

IMO there is no reason for keeping the old translation ids, because they are never used after this change.

Furthermore, anybody who uses custom blocks can have new block names.

Not sure to understand. Can you please elaborate?

For example this bundle has custom blocks. Luckily they have matching block and service id, but we can't guarantee it for every bundle in the wordl.

@@ -2,24 +2,24 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="sonata.block.container">
<source>sonata.block.container</source>
<trans-unit id="sonata.block.service.container">
Copy link
Member

Choose a reason for hiding this comment

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

IMO, just removing the .service will solve all our BC break issue. Am I wrong?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we just remove the .service in <service id="sonata.block.service... we have a BC break.

Copy link
Member

Choose a reason for hiding this comment

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

image

Copy link
Member Author

Choose a reason for hiding this comment

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

We can't handle this without a BC break. So which name do you prefer?

Copy link
Member

Choose a reason for hiding this comment

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

.service looks better.

@soullivaneuh
Copy link
Member

Could you please add a note about translation changes?

@soullivaneuh
Copy link
Member

Note: IMO, this PR should be merged at the very end to manage possible new block service before 4.0 release.

@core23
Copy link
Member Author

core23 commented Jun 17, 2016

Added a note the upgrade guide.

We should merge this ASAP in the master, so possible new blocks in this bundle could use the new mechanism.

@soullivaneuh
Copy link
Member

so possible new blocks in this bundle could use the new mechanism.

Absolutely not because new blocks in this bundle have to be added on 3.x, not master.

@greg0ire
Copy link
Contributor

greg0ire commented Aug 16, 2016

Absolutely not because new blocks in this bundle have to be added on 3.x, not master.

Should the base branch be changed then ?

@core23
Copy link
Member Author

core23 commented Aug 17, 2016

Should the base branch be changed then ?

Great feature from GitHub 🎉 We can't do this in the stable branch, because this is a BC.

@OskarStark
Copy link
Member

Nice feature 🎉

@OskarStark
Copy link
Member

anything todo here @core23 ?

@core23
Copy link
Member Author

core23 commented Sep 15, 2016

As @soullivaneuh mentioned, this should be done just before releasing the 4.0 version.

Or we must care that the block name and service id is the same when creating new block inside the sonata bundles.

@greg0ire
Copy link
Contributor

greg0ire commented Nov 4, 2016

Should we close this one in favor of #344 ?

@core23
Copy link
Member Author

core23 commented Nov 5, 2016

No, this is the master change that will remove the BC and changes the block id's.

@greg0ire
Copy link
Contributor

greg0ire commented Nov 5, 2016

Oh ok, great! But I think we shouldn't merge it until #344 is merged, and 3.x is merged into master, ok?

@SonataCI
Copy link
Collaborator

Could you please rebase your PR and fix merge conflicts?

@core23
Copy link
Member Author

core23 commented Dec 24, 2016

Rebased

@greg0ire greg0ire merged commit 15d0a64 into sonata-project:master Jan 2, 2017
@greg0ire
Copy link
Contributor

greg0ire commented Jan 2, 2017

Thanks @core23 !

@core23 core23 deleted the feature/di-name branch January 2, 2017 13:51
@jordisala1991 jordisala1991 mentioned this pull request Feb 1, 2018
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.

None yet

5 participants