Skip to content

Thymeleaf Date Dialect Bean in ThymeleafAutoConfiguration #1120

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

Closed
wants to merge 7 commits into from
Closed

Conversation

mxab
Copy link
Contributor

@mxab mxab commented Jun 17, 2014

Hi I added the DataAttributeDialect to ThymeleafAutoConfiguration

@@ -148,6 +150,17 @@ public LayoutDialect layoutDialect() {
}

@Configuration
@ConditionalOnClass(name = "com.github.mxab.thymeleaf.extras.dataattribute.dialect.DataAttributeDialect")
Copy link
Member

Choose a reason for hiding this comment

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

I think you can use value= here (and the class literal)

@dsyer
Copy link
Member

dsyer commented Jun 18, 2014

Thanks! I added a small comment on one line. We have to decide if it's OK to add a new dependency in 1.1.* or if it's better to wait till 1.2. Probably @wilkinsona will have the key opinion and he's on PTO at the moment.

@mxab
Copy link
Contributor Author

mxab commented Jun 18, 2014

Hey thanks, I thought also that the class makes more sense at that point, but the ThymeleafWebLayoutConfiguration had it also via the name=".." attribute so I thought I make it analog to that.

One more issue I have is if I should use @ConditionalOnMissingBean(DataAttributeDialect.class) since application that have already declared a DataAttributeDialect bean would have two then? (i.e. sagan)

@dsyer
Copy link
Member

dsyer commented Jun 18, 2014

I think value= is OK at the type level, so I assume ThymeleafWebLayoutConfiguration is being over cautious (you should be able to test it by running a sample app that doesn't have the class but is a Thymeleaf app).

@ConditionalOnMissingBean defaults to the type of the @Bean it is decorating, so you might be able to skip that. Testing with Sagan is always a good idea.

@mxab
Copy link
Contributor Author

mxab commented Jun 19, 2014

I changed it to the class literal, further I included it in the thymeleaf starter dependencies and extended the spring-boot-sample-web-ui example project by some simple data dialect usage

@wilkinsona
Copy link
Member

We have to decide if it's OK to add a new dependency in 1.1.* or if it's better to wait till 1.2

I'd prefer that we wait for 1.2

@dsyer
Copy link
Member

dsyer commented Jun 24, 2014

Daniel Fernandez (Thymeleaf lead) has some concerns about this dialect, so I'm not sure we want it to be part of the starter. I know it is in use in Sagan, so I have no problem with including autoconfiguration, but maybe you should contact Daniel and discuss his concerns anyway (I'd be happy to set that up if I knew your email address).

@mxab
Copy link
Contributor Author

mxab commented Jun 26, 2014

I thought already that I went to far by including it in the starter :) I'll remove it. I have Daniels email address and will contact him.

Max Bruchmann added 2 commits July 1, 2014 16:56
@mxab
Copy link
Contributor Author

mxab commented Jul 1, 2014

Ok I reverted the last commit

@markfisher markfisher added this to the 1.1.4 milestone Jul 3, 2014
@markfisher markfisher closed this Jul 3, 2014
@markfisher markfisher reopened this Jul 3, 2014
@philwebb philwebb removed this from the 1.1.4 milestone Jul 3, 2014
@wilkinsona
Copy link
Member

Master's building 1.2 now so we can start thinking about merging this. @mxab have you signed the CLA?

@mxab
Copy link
Contributor Author

mxab commented Jul 28, 2014

yep signed it

@wilkinsona wilkinsona self-assigned this Jul 29, 2014
@wilkinsona wilkinsona added this to the 1.2.0 milestone Jul 29, 2014
@wilkinsona
Copy link
Member

Squashed and merged. Thanks for the contribution, @mxab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants