pwa icon indicating copy to clipboard operation
pwa copied to clipboard

Make library compilable for Native Dart

Open vzool opened this issue 3 years ago • 7 comments

#38 #32

  • [x] Let's rename client.dart into pwa.dart. This should give us a clear entry point.
  • [x] It should also export the interface.dart.
  • [x] Let's move the platform-specific parts, and maybe also interface.dart inside lib/src.
  • [x] Let's use createPwaClient() instead of Client.create. (Client is now a single-method abstract class, no need for it).
  • [x] Let's rename BaseClient to Client (since Client is gone, and reducing breaking change's scope).
  • [ ] Let's bump version to 0.3.0 and also write a small note in CHANGELOG.md
  • [ ] Let's update examples.

vzool avatar Mar 16 '21 13:03 vzool

In fact, I don't know how to test a flutter library until I met this post. So, I made a new working update.

New registration way:

import 'package:pwa/client.dart' as pwa;

void main() async {
  // register PWA ServiceWorker for offline caching.
  pwa.Client.create();

  // ...
}

vzool avatar Mar 17 '21 07:03 vzool

I think this is going in the right direction, but I still would like to request a few refactor changes:

  • Let's rename client.dart into pwa.dart. This should give us a clear entry point.
  • It should also export the interface.dart.
  • Let's move the platform-specific parts, and maybe also interface.dart inside lib/src.
  • Let's use createPwaClient() instead of Client.create. (Client is now a single-method abstract class, no need for it).
  • Let's rename BaseClient to Client (since Client is gone, and reducing breaking change's scope).
  • Let's bump version to 0.3.0 and also write a small note in CHANGELOG.md
  • Let's update examples.

I think the first few are just quick mechanic changes, maybe the last point will be a bit more work, but after that this is ready to go.

isoos avatar Mar 17 '21 07:03 isoos

Ok captin, let's made a checklist for this.

vzool avatar Mar 17 '21 07:03 vzool

New registration way now is:

import 'package:pwa/pwa.dart' as pwa;

void main() async {
  // register PWA ServiceWorker for offline caching.
  pwa.Client.create();

  // ...
}

vzool avatar Mar 17 '21 07:03 vzool

New registration way now is:

import 'package:pwa/pwa.dart';

void main() async {
  // register PWA ServiceWorker for offline caching.
  createPwaClient();

  // ...
}

vzool avatar Mar 17 '21 08:03 vzool

  • Let's bump version to 0.3.0 and also write a small note in CHANGELOG.md

I think this can now be bumped up then we can update the examples easily.

vzool avatar Mar 17 '21 08:03 vzool

Any updates on this?

eliabieri avatar Feb 26 '22 11:02 eliabieri