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

FS Collection alternative #118

Open
balibou opened this issue Aug 12, 2016 · 19 comments
Open

FS Collection alternative #118

balibou opened this issue Aug 12, 2016 · 19 comments

Comments

@balibou
Copy link

balibou commented Aug 12, 2016

Hello,

Is it planned to go on an alternative to FSCollection (because deprecated) ?
Like webapp (http://docs.meteor.com/packages/webapp.html and https://iamlawrence.me/uploading-files-with-meteor)

@Mokto
Copy link
Contributor

Mokto commented Aug 15, 2016

Not it is not planned, but PR are welcome.

I use Meteor Files which works quite well for me right now.

@dr-dimitru
Copy link

Hi all,

I would like to create integration for Meteor-Files, is there any chance to point me to right direction?

@Mokto or MF already works with react-native-meteor well and there is no need to add native support?

@noris666
Copy link
Collaborator

@dr-dimitru MF not already works with this package, this is good idea about create integration.
I made an example, but my solution not really perfect.
https://github.com/noris666/Meteor-Files-POST-Example

@dr-dimitru
Copy link

dr-dimitru commented Sep 26, 2016

Here is great migration guide: https://github.com/VeliovGroup/Meteor-Files/wiki/Converting-from-CollectionFS made by community members whoops, wrong thread

@dr-dimitru
Copy link

@noris666 great code, will pass it to @oeway

@dr-dimitru
Copy link

Hey @noris666 ,

You've made a great example, is there any chance to make as part of MF wiki?

@noris666
Copy link
Collaborator

@dr-dimitru if you want use my code for examples, no problem with this :-)
Also you say about integration Meteor Files with react-native-meteor ?
Any news about this ?

@dr-dimitru
Copy link

Also you say about integration Meteor Files with react-native-meteor ?

Yes, is there any chance to point me to right direction?

if you want use my code for examples, no problem with this :-)

I can do it by myself (but don't have much time for testing), or you can send PR, up to you.

@noris666
Copy link
Collaborator

noris666 commented Oct 9, 2016

@dr-dimitru

Yes, is there any chance to point me to right direction?

Of course. Here no problem.

I can do it by myself (but don't have much time for testing), or you can send PR, up to you.

Now i develop 2 applications and in this projects need file uploads.
We can try develop upload files via DDP and POST, i think it is better ways for mobile applications and integration with Meteor.

@cyclops24
Copy link

cyclops24 commented Dec 29, 2016

Guys what's new news about integrating https://github.com/VeliovGroup/Meteor-Files in react-native-meteor?

VeliovGroup/Meteor-Files is seems awesome and also it's maintained well. I think it's the best alternative for deprecated FSCollection version.

**/CC: ** @noris666
**/CC: ** @dr-dimitru

@lc3t35
Copy link

lc3t35 commented Nov 20, 2017

Hi, I had a closer look to the feasability of providing Meteor-Files in react-native-meteor.
Meteor-Files is a meteor package, we can just focus on the client side, first problem is the strong dependency on meteor's packages such as "check", "check" uses Meteor functions such as Meteor.EnvironmentVariable, Meteor.makeErrorType. Maybe we can remove checks for now.
Next dependency is with ostrio:cookies which use Meteor's http, but it's just a get, so can be fixed in RN.
Next dependency is with meteor/reactive-var in upload.js, might be ok with trackr ?
The other tricky part seems to be the worker, maybe could use https://github.com/devfd/react-native-workers ?
Not simple task for just one brain indeed ! Help is welcome ;)

@dr-dimitru
Copy link

@lc3t35

  1. check package can be replaced with dummy package, or all "checks" can be removed from code;
  2. Cookies is only needed for http upload transport, and protecting files from unrestricted download. If you're on ddp transport and not using "protected" files you will be good without Cookies package;
  3. Web Workers can be disabled.

@dr-dimitru
Copy link

@lc3t35 do you have any results so far?

@lc3t35
Copy link

lc3t35 commented Nov 28, 2017

@dr-dimitru I did not get any further with this option. I moved to fetch a formData into Picker's (meteor/meteorhacks:picker) api handling the FilesCollection.
if FilesCollection where supported by react-native-meteor, I could just do :

      this.props.Images.insert({
        file: this.props.image.uri,
        streams: 'dynamic',
        chunkSize: 'dynamic',
      }, false).on('start', function () {
        this.setState({ uploading: true });
      }).on('end', function (error, fileObj) {
        if (error) {
          this.props.alertWithType('warning', 'Error', '');
        } else {
          this.setState({ uploading: false });
          this.props.onProgress(false, 0);
        }
      }).start();

For now it's way more complicated and I don't have progress feedback with fetch/picker ;)

@dr-dimitru
Copy link

@lc3t35 for progress use progress event

@lc3t35
Copy link

lc3t35 commented Nov 28, 2017

@dr-dimitru I know that ! I meant I don't have progress feedback with fetch/picker (previous post edited for clarity) ;) For now I don't have time to go deeper into this, maybe in January.

@dr-dimitru
Copy link

@lc3t35 whoops, misunderstood :)
Perhaps I'm speaking code too much.

Ok, get back to this whenever you'll have a time for it.

If anyone else is ready to try integrate MF package with react-native - I'm ready to create "truncated" version removing unneeded parts, as described here - #118 (comment)

@AbednegoTM
Copy link

@dr-dimitru did you create. the truncated version. I used MF when learning react it worked perfectly, I would love to use it with RN as well. am new RN and still exploring MF

@dr-dimitru
Copy link

Hey @AbednegoTM ,

No news here, looks like there isn't a lot of interest towards this ticket.
I'm still ready to contribute, but need someone who will continue supporting it, fix bugs, etc. Mainly we're looking for main contributor here.

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

No branches or pull requests

7 participants