-
Notifications
You must be signed in to change notification settings - Fork 15
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
Why is the API shape different to share target? #63
Comments
Related: w3c/web-share-target#84. I wish we would align on using |
Yah, converging on It might also be worth considering a manifest entry that controls both file-handling and share-target at once. It seems like you'd always want both. |
I'm not too certain about the history here, but it looks like there was already some discussion in 2019 in w3c/web-share-target#84, with the conclusion being to switch to align on using launchQueue. I'll cc @mgiuca in case there's more thoughts, but I'm not sure if there's anything actionable in this repo if we hope to align on using launchQueue (which file-handling already uses). |
It'd be good to add it to the explainer. It currently mentions that share-target is different but it doesn't explain why. Although, there's a further question of whether these things should be separate features at all. |
I tend to agree that the That said, the POST model definitely feels pretty unergonomic when you do want to handle things in JavaScript (I vaguely remember having to set up broadcast listeners to make sure the page is ready to receive the shared data). I also recall there being some discussion about the shape of the entry in the WebAppManifest, and why they aren't more similar (see #2 and #7). I think #7 also includes some of the reasoning that caused us to diverge from the WebShareTarget API in the first place. |
I think this was raised in #2 (comment) and our consensus at the time was that some apps might only be interested in one or the other (and that sharing and file handling are different use cases), though it's quite possible things have changed, especially now the File System stuff is further along. Note: I don't work on this any more, so take everything I say with a large spoonful of salt 😄 |
Even if they need to be seperate, it should be easy to use them together. As in, same manifest structure, and same way to access the file(s). |
So I think I explained my original reasoning for this on w3c/web-share-target#84. There were good reasons for it (this was deliberate design, not an accident), but I think in hindsight I do agree with Jake's opinion on both here and that bug: we should change Share Target to allow for a I disagree with deprecating We won't change File Handling to match Share Target ( Coincidentally, we were just discussing a new need for this today: to integrate Share Target with Declarative Link Capturing (which in its current form would not be able to navigate to a new URL and preserve the Historical / Explanatory Note The reason why Share Target and File Handlers differ is because they represent two fundamentally different concepts.
In simple terms, Share Target is "pass by value" and File Handling is "pass by reference". Share Target is conceptually the same as a form submission, only the data comes from another app rather than from an HTML form. That's why it was originally designed (pre file sharing) to put the data in the URL, just like a File Handling is nothing like this. Since we aren't making a copy of the file, the site actually needs to have a So that's why they are different. But I agree that we should add a third option to Share Target to allow developers to access the share data in a JavaScript object, just like File Handling, and we should design that API as close as possible to File Handling. |
Thank you for pointing out the conceptual differences between share target & file handling. Maybe put it in the explainer, or link to your comment? Fwiw, although I found the |
It seems like there'll be a ton of cross-over between this feature and share target. In fact, I can't think of cases where you'd want one, but not the other.
I was sad to see that I'd need to set up a significantly different code path for this vs share target.
Would it be possible to converge on one API pattern (either both use POST, or both use
launchQueue
)?The text was updated successfully, but these errors were encountered: