To me, there’s a bigger issue we’re grappling with:

For better or for worse, dealing with untyped objects is a reality in web 
development. Web is and will be an important target for Royale for the 
foreseeable future. We need a pattern which best deals with this.

Untyped object can come in the form of:
1. JSON
2. API requests which have specific parameters.
3. Interop with external JS. (Something I’ve had to deal with a lot.)
4. Native JS APIs such as the case of BlobPropertyBag that we’re discussing as 
an example.

We need to settle on a pattern which deals with these cases. Alex is saying 
that using “as” every time we need to avoid a compiler complaining is not a 
good pattern. I agree with that.

Alex is proposing factory functions.
I’m proposing “dynamic interfaces” or “typedef” declarations as Greg pointed 
out.

HTH,
Harbs

> On Jan 7, 2019, at 12:01 PM, Olaf Krueger <m...@olafkrueger.net> wrote:
> 
> Hi,
> sorry for annoying you but there's something which I'd like to understand:
> 
> If I understand it correctly, the issue is caused by the recent Google
> Closure thing which expects typed constructor parameters now.
> If I got it right, Google Closure is used for the JS target only.
> 
> So, it seems to me that this is a "JS target only" issue which is currently
> resolved by Yishay's commit [1].
> Even if this is maybe not nice, my understanding is that this is only needed
> for the JS target, within the "COMPILE::JS" sections.
> 
> So, my question is why this issue needs to be resolved "cross-platform" for
> other targets.
> Is it because of an assumption that other targets may also expect typed
> constructor parameters?
> 
> The other question is why we are allowing the usage of these plain objects
> as parameters at all.
> Alex probably already explained it but I don't get it entirely.
> Is it why it would be too much overhead to create all those needed classes
> and interfaces?
> (In case of performance, or in case of effort, ...?).
> 
> Thanks in advance!
> Olaf
> 
> [1] 
> var blob:Blob = new Blob([text], { type: 'text/plain' } as BlobPropertyBag);
> 
> 
> 
> 
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/

Reply via email to