Re: [ANN] Akasha: Typed Browser API version 0.24 released

2021-09-15 Thread Peter Donald
Hi,

On Wed, Sep 15, 2021 at 6:27 PM Jens  wrote:

> really interesting work, but don't you think something like feature
> detection should be handled by a dedicated library like Modernizr for
> example? You likely want to check for vendor prefixed support when you do
> feature detection.
>

It depends upon the actual feature detection that is taking place. All the
akasha stuff does is check whether a property/function is present on an
object. So mostly it allows you to replace something like:

if (Js.global().has("indexedDB")) { /* perform logic requiring indexDB */ }

with:

if (WindowGlobal.isIndexedDBSupported()) { /* perform logic requiring
indexDB */ }

Largely Akasha assumes that browsers conform with the HTML Living document
(or whatever it is called) or the underlying spec and only presents the
prefixes that are declared as part of the living document. If you want to
perform more complex feature detection and polyfills (i.e. assigning
prefixed version to unprefixed property or adding polyfills or detecting
non-code related features such as css properties) then going with a
dedicated library is a better option.

Mostly we have found that our needs are served with pretty simple feature
detection but YMMV

-- 
Cheers,

Peter Donald

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc6Yrhv1E_oMKiP8TBzMHOhHkj%2BULXNnh98Sup8NmG5rMw%40mail.gmail.com.


Re: [ANN] Akasha: Typed Browser API version 0.24 released

2021-09-15 Thread Jens
Hi,

really interesting work, but don't you think something like feature 
detection should be handled by a dedicated library like Modernizr for 
example? You likely want to check for vendor prefixed support when you do 
feature detection.

-- J.

peter.j...@gmail.com schrieb am Dienstag, 14. September 2021 um 02:48:52 
UTC+2:

> Akasha is a typed browser API layer that is always up to date with the 
> latest web specifications.
>
> Several significant changes have been made since the 0.17 announced to 
> this group. The major changes include:
>
>
>- The ability to test for features before using the feature 
>using methods such as WindowGlobal.isIndexedDBSupported(). The feature 
>tests can be done dynamically at runtime or statically at compile-time. If 
>done at compile time then the code can be compiled assuming that the 
>feature is present or absent.
>- Global execution contexts other than "window" are natively 
>supported. From a practical perspective this means it is relatively easy 
> to 
>use Akasha to write service workers and access the globals via 
>ServiceWorkerGlobal. Similarly  there exists AudioWorkletGlobal and 
>DedicatedWorkerGlobal etc. Within a GWT application, these global 
>execution contexts may still require custom linkers but are much easier to 
>write.
>
> Other changes since the 0.17 release:
>
>- Update the WebGPU spec to the W3C Working Draft, 10 September 2021 
> version. 
>This update resulted in a few minor name changes (i.e. the 
>GPURequestAdapterOptions.forceSoftware member was renamed to 
>GPURequestAdapterOptions.forceFallbackAdapter, GPUAdapter.isSoftware was 
>renamed to GPUAdapter.isFallbackAdapter) as well as improved modelling 
>of the types that contain constants (i.e. GPUMapMode no longer extends 
>JsObject and is a final class in the java binding).
>- Update the Permissions spec to the W3C Working Draft 07 September 
>2021 version. This update resulted in a few minor changes to the 
>PermissionsName enumeration, the addition of the name attribute to the 
>PermissionStatus type and the removal of the (unused) 
>PermissionSetParameters.
>- Update the WebCodecs spec to the W3C Working Draft, 8 September 2021 
> version. 
>This update resulted in many changes across several types. See the API 
> diff 
>for further details.
>- Migrate artifacts generated from the WebCodecs spec to the package 
>codecs in the java binding.
>- Update the Visual Viewport API spec to the Draft Community Group 
>Report 10 September 2021 version. This update resulted in the 
>VisualViewport.segments attribute being made optional (or Nullable in 
>the java binding).
>- Update the Web Share API spec to the W3C Working Draft 03 September 
>2021 version. This update resulted in the addition of the 
>Navigator.canShare(...) operation.
>- Update the WebXR Device API spec to the W3C Working Draft, 24 August 
>2021 version. This update resulted in several changes, check the API 
>diff for further details.
>- Update the HTML Living Standard spec to the 11 September 2021 version. 
>This update resulted in several changes, check the API diff for further 
>details. The most significant changes were the addition of 
>oncontextlost and oncontextrestored message handlers to several types 
>and the addition of isContextLost() to contexts as appropriate.
>- Updates across several specifications resulted in PostMessageOptions 
> being 
>renamed to StructuredSerializeOptions.
>- Re-fetch the entire set of specifications ensuring that the required 
>members in dictionaries appear in declaration order as initiated in 
> version 
>v0.15. This has resulted in the reordering of parameters in create() 
> methods 
>in the java binding to represent members in declaration order. This 
>impacted the following types at a minimum: StaticRangeInit, 
>XRInputSourcesChangeEventInit, RTCRtpCodecCapability, 
>RTCRtpCodecParameters, RTCRtpContributingSource, 
>RTCRtpHeaderExtensionParameters, RTCRtpParameters, RTCRtpSendParameters
>, RTCStats, RTCTrackEventInit, HkdfParams, Pbkdf2Params, 
>AllowedBluetoothDevice, AudioProcessingEventInit, IIRFilterOptions, 
>OfflineAudioContextOptions (as well as several other less used 
>dictionaries)
>- Rename several union types to reflect intent, migrate the unions to 
>the java package where they are used and convert unions to marker 
>interfaces where appropriate. i.e. The union type 
>IDBObjectStoreOrIDBIndexUnion was renamed to IDBCursorSource, 
>converted to a marker interface and migrated to the akasha.idb java 
>package. See the API diff for a full list of unions migrated.
>- Type the AudioTrack.kind attribute as an enumeration containing the 
>set of valid values.
>- Add the Resize Observer spec at W3C First Public Wo

[ANN] Akasha: Typed Browser API version 0.24 released

2021-09-13 Thread Peter Donald
Akasha is a typed browser API layer that is always up to date with the
latest web specifications.

Several significant changes have been made since the 0.17 announced to this
group. The major changes include:


   - The ability to test for features before using the feature
   using methods such as WindowGlobal.isIndexedDBSupported(). The feature
   tests can be done dynamically at runtime or statically at compile-time. If
   done at compile time then the code can be compiled assuming that the
   feature is present or absent.
   - Global execution contexts other than "window" are natively supported.
   From a practical perspective this means it is relatively easy to use Akasha
   to write service workers and access the globals via ServiceWorkerGlobal.
   Similarly  there exists AudioWorkletGlobal and DedicatedWorkerGlobal
   etc. Within a GWT application, these global execution contexts may still
   require custom linkers but are much easier to write.

Other changes since the 0.17 release:

   - Update the WebGPU spec to the W3C Working Draft, 10 September
2021 version.
   This update resulted in a few minor name changes (i.e. the
   GPURequestAdapterOptions.forceSoftware member was renamed to
   GPURequestAdapterOptions.forceFallbackAdapter, GPUAdapter.isSoftware was
   renamed to GPUAdapter.isFallbackAdapter) as well as improved modelling
   of the types that contain constants (i.e. GPUMapMode no longer extends
   JsObject and is a final class in the java binding).
   - Update the Permissions spec to the W3C Working Draft 07 September
2021 version.
   This update resulted in a few minor changes to the PermissionsName
enumeration,
   the addition of the name attribute to the PermissionStatus type and the
   removal of the (unused) PermissionSetParameters.
   - Update the WebCodecs spec to the W3C Working Draft, 8 September
2021 version.
   This update resulted in many changes across several types. See the API diff
   for further details.
   - Migrate artifacts generated from the WebCodecs spec to the package
   codecs in the java binding.
   - Update the Visual Viewport API spec to the Draft Community Group
   Report 10 September 2021 version. This update resulted in the
   VisualViewport.segments attribute being made optional (or Nullable in
   the java binding).
   - Update the Web Share API spec to the W3C Working Draft 03 September
   2021 version. This update resulted in the addition of the
   Navigator.canShare(...) operation.
   - Update the WebXR Device API spec to the W3C Working Draft, 24 August
   2021 version. This update resulted in several changes, check the API
   diff for further details.
   - Update the HTML Living Standard spec to the 11 September 2021 version.
   This update resulted in several changes, check the API diff for further
   details. The most significant changes were the addition of oncontextlost
and oncontextrestored message handlers to several types and the
   addition of isContextLost() to contexts as appropriate.
   - Updates across several specifications resulted in PostMessageOptions being
   renamed to StructuredSerializeOptions.
   - Re-fetch the entire set of specifications ensuring that the required
   members in dictionaries appear in declaration order as initiated in version
   v0.15. This has resulted in the reordering of parameters in create() methods
   in the java binding to represent members in declaration order. This
   impacted the following types at a minimum: StaticRangeInit,
   XRInputSourcesChangeEventInit, RTCRtpCodecCapability,
   RTCRtpCodecParameters, RTCRtpContributingSource,
   RTCRtpHeaderExtensionParameters, RTCRtpParameters, RTCRtpSendParameters,
   RTCStats, RTCTrackEventInit, HkdfParams, Pbkdf2Params,
   AllowedBluetoothDevice, AudioProcessingEventInit, IIRFilterOptions,
   OfflineAudioContextOptions (as well as several other less used
   dictionaries)
   - Rename several union types to reflect intent, migrate the unions to
   the java package where they are used and convert unions to marker
   interfaces where appropriate. i.e. The union type
   IDBObjectStoreOrIDBIndexUnion was renamed to IDBCursorSource, converted
   to a marker interface and migrated to the akasha.idb java package. See
   the API diff for a full list of unions migrated.
   - Type the AudioTrack.kind attribute as an enumeration containing the
   set of valid values.
   - Add the Resize Observer spec at W3C First Public Working Draft, 11
   February 2020 version to the set of specs that are used to generate the
   browser API. This added the ResizeObserver type and related
   infrastructure.
   - Generate static types for global execution contexts of a service
   worker (i.e. SharedWorkerGlobal), a worker (i.e. DedicatedWorkerGlobal),
   a shared worker (i.e. SharedWorkerGlobal) and audio worklets (i.e.
   AudioWorkletGlobal).
   - Change the way the java binding generates unions so that methods of
   the form as[X]() and is[X]() exist for every component type X that is