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

Polyfills to enable browser-based libraries to work in {N} project #351

Closed
valentinstoychev opened this issue Jun 22, 2015 · 21 comments
Closed

Comments

@valentinstoychev
Copy link

Lets collect common polyfills that need to be implemented in NativeScript in order to support browser-based libraries.

We already have support for XHR, which enables libraries that work with cloud data to work out of the box in NativeScript, but what would be other polyfills that we can add to NativeScript?

A good starting point will be an example of a browser library that you want to run inside NativeScript app.

@RangerMauve
Copy link

Websockets are probably the biggest, followed by canvas. Maybe the notifications api

@bfattori
Copy link

WebSockets, WebGL, Canvas, custom font loading, and something for audio is on my immediate list.

I was going to implement this with java_websockets and iOS websockets. But if you can beat me to it, I'm okay with that!

@emiloberg
Copy link

WebSockets indeed! For all thing realtime.

@bfattori
Copy link

I have a near complete WebSocket plugin... But, as I'm not an iOS developer, I could only get the Android side working. I grabbed java_websockets (android) and JetFire (iOS) to be the implementations since I've used the Android one before and JetFire was recommended. I should have a browser-esque WebSocket implementation any day now.

@bfattori
Copy link

I now have the iOS side working, but as yet not fully tested.

@valentinstoychev
Copy link
Author

Hey @bfattori is the plugin available on Github or somewhere else to check it out?

We are planning to open a verified plugins marketplace in August and if you are interested you can publish it there. I can provide you with more information in case you are interested.

@bfattori
Copy link

Unfortunately, no. I wrote the code for my company. I'm trying to get them
to open source it, but I've been told it probably won't happen. I'll keep
pushing though. It's now working on both iOS and Android, so I'd love for
others to be able to use it.

Are the plugins meant to be free (open source) or pay-for, or either?

@valentinstoychev
Copy link
Author

They can free or paid and there is no need for them to be open sourced. They can be licensed with any license - proprietary included. cc:/ @kiril-stanoev

@NathanaelA

This comment was marked as abuse.

@emmanuelbuah
Copy link

@bfattori Tell your company they are using nativescript for free. If they can't contribute a plugin in return then ....they aren't being fair and should be ashamed.
@NathanaelA Thanks for all your hard work. Per #167, i have just been swamped to work on this. The community will be grateful for your contribution. If you have a repro, kindly share it with @valentinstoychev and the community. Thanks.

@NathanaelA

This comment was marked as abuse.

@emmanuelbuah
Copy link

@NathanaelA Thanks for the hard work. Will check it out.

@emmanuelbuah
Copy link

@valentinstoychev How about flexbox layout as layout engine?

@hshristov
Copy link
Contributor

HI @emmanuelbuah,

Are there any particular problem you are facing with our current layout support? Is it hard to understand and/use? Any scenario that you cannot cover with it?
It will be of great help if we identify current issues that people are struggling with.

@benkingcode
Copy link

@hshristov I think the current Layout engine is fine, but it's very specific to NativeScript. One of the big benefits of the platform is skills reuse - allowing web developers to come over to building native mobile apps. Being able to use (a subset) of CSS is a great start, but if the CSS support expanded to supporting layout structures like grid/flexbox, it'd be even easier for developers to adopt the platform.

@emmanuelbuah
Copy link

Per my answer at #191 (comment)

Its widely known/used since its part of the css 3 spec. It will make it easy for developers coming from the web tech to get up and running rather than learn a new layout engine. This by no means assert that the current layout engine is bad. I just think adaptation will be faster and easier for devs coming from js/web tech.

@hshristov spot on

@hshristov
Copy link
Contributor

What bugs me in the flexbox layout is that it is supposed to be used without changing the html. I'm by no means html, css expert - quite the opposite so please correct me if I'm wrong. You just mark one element as flexbox container and that's it. But in the native platforms (like Android and WU) elements cannot be added everywhere. Only ViewGroup (in Android) can have children.

So it will not be possible to specify the layout using only CSS. One should have something like FlexboxLayout element somewhere in the XML.

Doesn't this defeat the purpose of flexbox?

@valentinstoychev
Copy link
Author

I agree with most that flexbox is very well suited for NativeScript. The most important part is that it is known and will not require additional learning. I'm also sure that the current layout implementation in NativeScript is much more powerful and enables many scenarios.

With that said - I think that the core team behind the project can focus on bringing additional features and other core capabilities to the product and the flexbox layout will be a very good task for the community to work on. It can be easily distributed as a plugin via npm and anyone will be able to easily consume it.

If someone decides to put some development cycles into this I'm sure @hshristov will help you out with any questions during the development.

@enchev
Copy link
Contributor

enchev commented Feb 25, 2016

I've created separate issue for flexbox #1650

@enchev
Copy link
Contributor

enchev commented Mar 15, 2016

I'm closing this since it is too general.

@enchev enchev closed this as completed Mar 15, 2016
@lock
Copy link

lock bot commented Aug 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants