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

Web support vol.2 #190

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Web support vol.2 #190

wants to merge 4 commits into from

Conversation

vaind
Copy link
Contributor

@vaind vaind commented Feb 8, 2021

Part of #185

  • adds objectbox-javascript library stub
  • adds a test file that can be run in the browser
  • evaluates dart vs JS-interop call performance

TODO:

  • Add a simple IndexedDB performance evaluation, comparing
    • dart:indexed_db vs JS IndexedDB
    • storing objects vs storing strings (a.k.a. flatbuffers data), ideally strings should be real flabuffers to also evaluate FB serialization cost in the browser
  • check how generic classes are handled by webpack & dart-js code interop (including generator)

Base automatically changed from web-support-1 to main March 8, 2021 07:22
@srix55
Copy link

srix55 commented Jun 10, 2021

Eagerly awaiting web support. Would be great to see the package with all platform support on pub dev.

@fMeow
Copy link

fMeow commented Aug 19, 2021

What is the current progress? The last commit is nearly half a year ago. Is there any obstacle? What can I help with?

@greenrobot
Copy link
Member

greenrobot commented Sep 4, 2021

@vaind Did you have any initial perf results yet?

We go with TypeScript, right? For web, I would even go forward with TypeScript if it would be significant slower that some Dart only thing (which seems quite unlikely unless there's some Dart quirk), so would not spent more time on Dart vs TS perf tests.

The scope of this PR should be a minimal Box APIs working; i.e. Box TypeScript API using IndexDB wrapped by Dart. Right?

Update: deferred the target architecture discussion to here.

@vaind
Copy link
Contributor Author

vaind commented Sep 4, 2021

@vaind Did you have any initial perf results yet?

no, these TODOs are up to date

@vaind
Copy link
Contributor Author

vaind commented Sep 4, 2021

We go with TypeScript, right? For web, I would even go forward with TypeScript if it would be significant slower that some Dart only thing (which seems quite unlikely unless there's some Dart quirk), so would not spent more time on Dart vs TS perf tests.

Looks like dart (compiled to javascript) may end up being faster than plain javascript:

dart-lang/sdk#38705 (comment)
Dart version, dart2js compiled -O4: 29ms
JavaScript version: 44ms

So it's not a clear decision (from the performance perspective) unless a small benchmark is created.

@greenrobot
Copy link
Member

So it's not a clear decision (from the performance perspective) unless a small benchmark is created.

No need. As I've mentioned before, the decision about the tech stack is not primarily about nuances of JS performance.

@vaind
Copy link
Contributor Author

vaind commented Sep 4, 2021

So it's not a clear decision (from the performance perspective) unless a small benchmark is created.

No need. As I've mentioned before, the decision about the tech stack is not primarily about nuances of JS performance.

Yes, in that case I agree TS might more useful (for future reuse) albeit a bit harder to implement than plain-dart solution

@richard457
Copy link

richard457 commented Dec 16, 2021

Any progress on this? @vaind

@richard457
Copy link

Found this This if it can be of help. !

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.

5 participants