Skip to content
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

Make library compilable for Native Dart #39

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

vzool
Copy link

@vzool vzool commented Mar 16, 2021

#38 #32

  • 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.

lib/client.dart Outdated Show resolved Hide resolved
lib/client.dart Show resolved Hide resolved
@vzool
Copy link
Author

vzool commented Mar 17, 2021

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 vzool requested a review from isoos March 17, 2021 07:14
@isoos
Copy link
Owner

isoos commented Mar 17, 2021

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.

@vzool
Copy link
Author

vzool commented Mar 17, 2021

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

@vzool
Copy link
Author

vzool commented Mar 17, 2021

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
Copy link
Author

vzool commented Mar 17, 2021

New registration way now is:

import 'package:pwa/pwa.dart';

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

  // ...
}

@vzool
Copy link
Author

vzool commented Mar 17, 2021

  • 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.

@eliabieri
Copy link

Any updates on this?

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

Successfully merging this pull request may close these issues.

3 participants