Comments (23)
we will update codebase after fibers phased out completely
@bratelefant @dr-dimitru would that imply there is no way to prepare migration until the full 3.0 is out? I think we have already some very sophisticated Alpha Releases (as of today the latest is 3.0.0-alpha.15) and I would like to slowly start migrating Files as well, especially since we do lots of stuff after upload (ffmpeg etc.)
from meteor-files.
@bratelefant just warnings for now, we will update codebase after fibers phased out completely
from meteor-files.
Also, it would be really nice if in the FilesCollection
the value of config.protected
could be a function that returns a promise resolving to true
or false
.
from meteor-files.
I agree, I think it would be really nice to get things going, since there'll be some time needed to do some proper testing files in a staging env, especially if you're using s3 or similar things.
we will update codebase after fibers phased out completely
@bratelefant @dr-dimitru would that imply there is no way to prepare migration until the full 3.0 is out? I think we have already some very sophisticated Alpha Releases (as of today the latest is 3.0.0-alpha.15) and I would like to slowly start migrating Files as well, especially since we do lots of stuff after upload (ffmpeg etc.)
from meteor-files.
@dr-dimitru , i'm running across an async issue using the interceptDownload method when trying to migrate to Meteor 3.0 async calls.
Using async/await below doesn't wait for the return true. Is it possible to add support for async in preparation for Meteor. 3.0.
async interceptDownload(http, fileRef, version) {
const displayName = await Pictures.findOneAsync(fileRef._id);
if (fileRef && displayName) {
// get file from S3 and serve file to client business logic
return true;
}
return false;
}
from meteor-files.
@dallman2 we are working on it today, sorry for the delay and thank you for the ping
from meteor-files.
@dr-dimitru @jankapunkt @bratelefant is there a PR in the works for this? We're currently migrating to Meteor 3, and file uploads and downloads are core to the product.
Sorry, not yet; it's on my list though
from meteor-files.
@fracz this library mostly relies on classic hooks and callbacks approach. Most of the changes will be done in the package internally with a goal to minimize changes within the integration guidelines
from meteor-files.
@dr-dimitru Not sure I understand this correctly. Do you mean you will not change the current API, but the underlying implementation will change?
@fracz You can always try FilesCollection.collection
if you need to use the *Async methods.
from meteor-files.
@make-github-pseudonymous-again yes, I don't see many changes in library's API
from meteor-files.
@dr-dimitru Not sure I understand this correctly. Do you mean you will not change the current API, but the underlying implementation will change?
@fracz You can always try
FilesCollection.collection
if you need to use the *Async methods.
FilesCollection.collection.async[...]
is working fine on the server side. However, if I FilesCollection.collection.insertAsync
on the client side, permissions aren't as expected and calling FilesCollection.insert
from the client yields server side calls on the corresponding __pre_...
collection.
from meteor-files.
FilesCollection.collection.insertAsync on the client side, permissions aren't as expected and calling
No changes need on the client, keep using callback API it would remain working as expected
from meteor-files.
@bratelefant also there's no .insert()
on the server, uploads are meant to work from Client to Server only
from meteor-files.
@bratelefant also there's no
.insert()
on the server, uploads are meant to work from Client to Server only
That is true, sorry for that confusion. However, using .insert()
on the client side yields async warnings when WARN_WHEN_USING_OLD_API=true
:
Calling method __pre_MyFilesCollection.insert from old API on server.
This method will be removed, from the server, in version 3.
Trace is below:
[object Object]
at warnUsingOldApi (packages/mongo/collection.js:24:12)
at ns.Collection.insert (packages/mongo/collection.js:569:5)
at ns.Collection.Mongo.Collection.<computed> [as insert] (packages/aldeed:collection2/collection2.js:217:19)
at MethodInvocation.FilesCollection._methods.<computed> (packages/ostrio:files/server.js:868:31)
at MethodInvocation.methodMap.<computed> (packages/montiapm:agent/lib/hijack/wrap_session.js:190:30)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1902:12)
at getCurrentMethodInvocationResult (packages/ddp-server/livedata_server.js:772:38)
at packages/meteor.js:365:18
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
at packages/ddp-server/livedata_server.js:791:46
at new Promise (<anonymous>)
at Session.method (packages/ddp-server/livedata_server.js:739:23)
at packages/montiapm:agent/lib/hijack/wrap_session.js:74:38
at packages/meteor.js:365:18
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
at Session.sessionProto.protocol_handlers.method (packages/montiapm:agent/lib/hijack/wrap_session.js:73:44)
Edit: Also, if one calls .addFile
on the server side, this seems to call this.collection.insert
in a fiber.
from meteor-files.
@dr-dimitru you accepting pull requests for this one?
@bratelefant interested in collabroating on a PR for this?
from meteor-files.
@jankapunkt sure, if you or someone else ready for this. Willing to help and assist as well
from meteor-files.
@jankapunkt sounds fun ;) I personally always considered meteor-files rather complicated, maybe since I didn't really get it as a beginner... this could be a good opportunity to better understand this package.
from meteor-files.
@bratelefant or we go together working on its successor in a simpler implementation 😅
from meteor-files.
@dr-dimitru @jankapunkt @bratelefant is there a PR in the works for this? We're currently migrating to Meteor 3, and file uploads and downloads are core to the product.
from meteor-files.
Related Issues (20)
- ENOENT: no such file or directory, mkdir HOT 18
- onBeforeUpload and other functions should be able to be asynchronous HOT 1
- Custom Endpoint for MinIO ? HOT 2
- What defines the filename of the saved file? HOT 2
- [FilesCollection.ServiceFile] Path "/assets/app/uploads/ServiceFileCollection" is not writable! HOT 2
- How to change item metadata before it is inserted into the collection? HOT 9
- How do I update a filesCollection after Server side Write created? HOT 1
- Get user ip on upload HOT 9
- Since Meteor 2.11 - Exception in setTimeout callback: TypeError: fs.remove is not a function HOT 9
- Question: Can you store directly in GridFS? HOT 2
- Question: Save link in database?
- Update aws-sdk to v3 in 'Use AWS:S3 As Storage' Documentation HOT 4
- Files.load -> options.fileName is not in filepath HOT 2
- FilesCollection.find(...).each() not working properly? HOT 1
- HTTP uploads not working, multi-instance/cluster environment NGINX balanced HOT 5
- onAfterUpload not throwing error in uploader.on('end') HOT 5
- Cannot stream a video with filenames longer than 80 characters HOT 1
- wrong custom error message when using HTTP
- Make Meteor-Files compatible with meteor-desktop? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-files.