Re: Adding @InjectComponent(optional = true) to complement @DisableStrictChecks

Ben Weidig <[email protected]>
Newsgroups gmane.comp.jakarta.tapestry.devel
Message-ID <CAMa1C31d2FxZrNaR-JPe1URKsfDMS-mvZrsOAHaUMXRj-JWSNA@mail.gmail.com>
Hi Thiago,

I always forget about making a new branch, I'll try to do that in the
future for non-trivial changes!
TAP5-2727 is pushed in masters now.
But if any issues arise, I got the time to fix them.

Regarding the 5.8.3, I'll answer in the other thread.

Yeah, it's great to see so much activity and new features and improvements!

Cheers
Ben

On Tue, May 31, 2022 at 2:09 PM Thiago H. de Paula Figueiredo <
[email protected]> wrote:

> On Sat, May 28, 2022 at 11:40 AM Ben Weidig <[email protected]> wrote:
>
> > Hello!
>
> Hi!
>
> > As discussed in a previous thread, I've created an issue for adding
> > "boolean optional() default false" to @InjectComponent to complement
> > @DisableStrictChecks.
> >
> > https://issues.apache.org/jira/projects/TAP5/issues/TAP5-2727
> >
> > The ticket contains a patch with an attempt to implement the required
> > behavior, plus some tests.
> > If optional() == true, the InjectComponentWorker just ignores the
> > UnknownValueException and the embedded component will be null.
> > That was the easiest way to implement it.
>
> After reading your message above and the patch, it gets a +1 from me.
> By the way, feel free to create branches for new features like this.
> It has one very nice bonus: Travis CI automatically runs tests on any
> branches: https://app.travis-ci.com/github/apache/tapestry-5/branches.
> This way, you can be sure you won't break anything before merging to
> master while still being able to have Git to store and version your
> changes.
>
> > Another option would be creating a proxy in case of an optional and
> missing
> > component, which reacts with an appropriate Exception if used.
> > Or do you think that's overkill?
>
> I believe it is overkill. In addition, you can just check for null
> instead of having to have a try/catch in order to know whether the
> injected component exists or not.
>
> Thank you for suggesting and implementing this! I really, really love
> all the activity we're having on Tapestry's repository lately. :)
>
> Also, I'd like to cut 5.8.3 soon to get CORS and everything else out
> there. Thoughts?
>
> Cheers!
>
> --
> Thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.