urbit / tree

The web interface for your urbit.
13 stars 7 forks source link

tree needs relative dataPath #9

Closed cgyarvin closed 8 years ago

cgyarvin commented 8 years ago

dataPath should be relative to current node.

ohAitch commented 8 years ago

dataPath is an internal prop and shouldn't be the canonical way to do this; what we actually need(/to run analogous-to-links path handling on) is a standard attribute like "src"

On Friday, 15 April 2016, cgyarvin notifications@github.com wrote:

dataPath should be relative to current node.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9

galenwp commented 8 years ago

I would adjust this to say 'a dataPath starting with a / is an absolute path, no starting / is a relative path and no dataPath implies the current path.'

galenwp commented 8 years ago

@ohAitch looking at the source I had a similar thought, but would that wrapping happen in async.coffee? If you know how you think this should be done and can do it quickly, that's great.

ohAitch commented 8 years ago

Yeah, I'm trying to solve two problems: a dataPath is of format "whatever tree gave me, which should be considered unstable" and should not have any clever handling applied to it; also dataPath is a weird tree-specific name anyway(and probably also unstable as far as the docs are concerned), if list components are to go in markdown they should look similar to stylesheets/iframes/etc.

And yes, assuming we have a util.relative-path(basePath,href), dropping that into Async should be fine. (More complicated handling would warrant an async-like wrapper that just turns and src into dataPath, but that's too much abstraction for two lines of code.)

On Friday, 15 April 2016, Galen Wolfe-Pauly <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

@ohAitch https://github.com/ohAitch looking at the source I had a similar thought, but would that wrapping happen in async.coffee? If you know how you think this should be done and can do it quickly, that's great.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210552514

cgyarvin commented 8 years ago

I just want it to work! dataPath doesn't really work if it's always absolute, because the whole point of a filesystem tree is that you can adjust it by moving nodes around with 'mv'.

On Fri, Apr 15, 2016 at 10:33 AM, Anton Dyudin notifications@github.com wrote:

Yeah, I'm trying to solve two problems: a dataPath is of format "whatever tree gave me, which should be considered unstable" and should not have any clever handling applied to it; also dataPath is a weird tree-specific name anyway(and probably also unstable as far as the docs are concerned), if list components are to go in markdown they should look similar to stylesheets/iframes/etc.

And yes, assuming we have a util.relative-path(basePath,href), dropping that into Async should be fine. (More complicated handling would warrant an async-like wrapper that just turns and src into dataPath, but that's too much abstraction for two lines of code.)

On Friday, 15 April 2016, Galen Wolfe-Pauly <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

@ohAitch https://github.com/ohAitch looking at the source I had a similar thought, but would that wrapping happen in async.coffee? If you know how you think this should be done and can do it quickly, that's great.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210552514

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210557820

galenwp commented 8 years ago

I don't think we have util.relative-path (which should be relativePath). What you're describing sounds like a relatively straightforward change — but as described it's one you're going to have an easier time making.

Does this look as easy to you as it sounds?

ohAitch commented 8 years ago

dataPath shouldn't be ~user visible~ Like, my goal with the dataPath->src change is so that dataPath is actually treated as "opaque value you got from treestore as props.path or props.sein", and can be swapped to a cheeky react-like {path:"/actual/value"}. Which is not a change that ever needs to be actually /made/, it just needs to not break anything.

On Friday, 15 April 2016, cgyarvin notifications@github.com wrote:

I just want it to work! dataPath doesn't really work if it's always absolute, because the whole point of a filesystem tree is that you can adjust it by moving nodes around with 'mv'.

On Fri, Apr 15, 2016 at 10:33 AM, Anton Dyudin <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

Yeah, I'm trying to solve two problems: a dataPath is of format "whatever tree gave me, which should be considered unstable" and should not have any clever handling applied to it; also dataPath is a weird tree-specific name anyway(and probably also unstable as far as the docs are concerned), if list components are to go in markdown they should look similar to stylesheets/iframes/etc.

And yes, assuming we have a util.relative-path(basePath,href), dropping that into Async should be fine. (More complicated handling would warrant an async-like wrapper that just turns and src into dataPath, but that's too much abstraction for two lines of code.)

On Friday, 15 April 2016, Galen Wolfe-Pauly <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com'); <javascript:_e(%7B%7D,'cvml','notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');');>> wrote:

@ohAitch https://github.com/ohAitch looking at the source I had a similar thought, but would that wrapping happen in async.coffee? If you know how you think this should be done and can do it quickly, that's great.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210552514

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210557820

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210559710

ohAitch commented 8 years ago

As soon as I find the relative path code(in Anchor somewhere?), yeah

On Friday, 15 April 2016, Anton Dyudin antechno777@gmail.com wrote:

dataPath shouldn't be ~user visible~ Like, my goal with the dataPath->src change is so that dataPath is actually treated as "opaque value you got from treestore as props.path or props.sein", and can be swapped to a cheeky react-like {path:"/actual/value"}. Which is not a change that ever needs to be actually /made/, it just needs to not break anything.

On Friday, 15 April 2016, cgyarvin <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I just want it to work! dataPath doesn't really work if it's always absolute, because the whole point of a filesystem tree is that you can adjust it by moving nodes around with 'mv'.

On Fri, Apr 15, 2016 at 10:33 AM, Anton Dyudin notifications@github.com wrote:

Yeah, I'm trying to solve two problems: a dataPath is of format "whatever tree gave me, which should be considered unstable" and should not have any clever handling applied to it; also dataPath is a weird tree-specific name anyway(and probably also unstable as far as the docs are concerned), if list components are to go in markdown they should look similar to stylesheets/iframes/etc.

And yes, assuming we have a util.relative-path(basePath,href), dropping that into Async should be fine. (More complicated handling would warrant an async-like wrapper that just turns and src into dataPath, but that's too much abstraction for two lines of code.)

On Friday, 15 April 2016, Galen Wolfe-Pauly <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

@ohAitch https://github.com/ohAitch looking at the source I had a similar thought, but would that wrapping happen in async.coffee? If you know how you think this should be done and can do it quickly, that's great.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210552514

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210557820

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210559710

ohAitch commented 8 years ago

Ah, util.relativePath would just be (a)->util.fragpath (new URL a, document.location).pathname, that works. On Friday, 15 April 2016, Anton Dyudin antechno777@gmail.com wrote:

As soon as I find the relative path code(in Anchor somewhere?), yeah

On Friday, 15 April 2016, Anton Dyudin antechno777@gmail.com wrote:

dataPath shouldn't be ~user visible~ Like, my goal with the dataPath->src change is so that dataPath is actually treated as "opaque value you got from treestore as props.path or props.sein", and can be swapped to a cheeky react-like {path:"/actual/value"}. Which is not a change that ever needs to be actually /made/, it just needs to not break anything.

On Friday, 15 April 2016, cgyarvin notifications@github.com wrote:

I just want it to work! dataPath doesn't really work if it's always absolute, because the whole point of a filesystem tree is that you can adjust it by moving nodes around with 'mv'.

On Fri, Apr 15, 2016 at 10:33 AM, Anton Dyudin <notifications@github.com

wrote:

Yeah, I'm trying to solve two problems: a dataPath is of format "whatever tree gave me, which should be considered unstable" and should not have any clever handling applied to it; also dataPath is a weird tree-specific name anyway(and probably also unstable as far as the docs are concerned), if list components are to go in markdown they should look similar to stylesheets/iframes/etc.

And yes, assuming we have a util.relative-path(basePath,href), dropping that into Async should be fine. (More complicated handling would warrant an async-like wrapper that just turns and src into dataPath, but that's too much abstraction for two lines of code.)

On Friday, 15 April 2016, Galen Wolfe-Pauly <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

@ohAitch https://github.com/ohAitch looking at the source I had a similar thought, but would that wrapping happen in async.coffee? If you know how you think this should be done and can do it quickly, that's great.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210552514

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210557820

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/urbit/tree/issues/9#issuecomment-210559710

ohAitch commented 8 years ago

fixing i said

galenwp commented 8 years ago

Thanks!