-
Notifications
You must be signed in to change notification settings - Fork 0
Completely rewrite pelias compare tool in vue #21
Conversation
This looks pretty awesome to me. Lots of great functionality we've wanted for a long time (check out #9 from 2015). Since we've been adding demos/interactive interfaces to most of our services, one option would actually be to move this code into https://github.com/pelias/api directly. Then we can archive this repo and move on. The main thing I'd like to make sure we achieve there is good developer ergonomics. Which basically means people doing general API development don't have to run Other than that, I think this is basically good to go. I noticed some checkboxes are out of alignment (at least for me, Firefox on Linux), but that's it. It's really nice! |
oh interesting re: moving into api/ - It seems like that might make things
slightly awkward for pelias due to the public compare tool @
https://pelias.github.io/compare/#/v1/search%3Ftext=london,%20uk - since
it wouldn't be easy to host this tool at github.io, you'd either need to
host your own copy of it as a standalone thing on s3, or have a gh-pages
branch on api/ which seems a little awkward & misaligned (I'd expect
gh-pages to have the api docs), or point your compare tool at a single
pelias shard.
If you still want me to try a version in api/ and you can figure out how
you want to host the public version, happy to do that.
re: dev ergonomics - 100% agree on keeping the api/ deps light and fast, so
definitely keeping this in it's own dir+package.json
Will look into the style issue you're seeing.
…On Tue, Mar 3, 2020 at 9:34 PM Julian Simioni ***@***.***> wrote:
This looks pretty awesome to me. Lots of great functionality we've wanted
for a long time (check out #9 <pelias/compare#9>
from 20*15*).
Since we've been adding demos/interactive interfaces to most of our
services, one option would actually be to move this code into
https://github.com/pelias/api directly. Then we can archive this repo and
move on.
In terms of doing that, the main thing I'd like to make sure we achieve is
good developer ergonomics. Which basically means people doing general API
development don't have to run npm install for the compare app unless they
really want to. We definitely don't want to add all the deps for the
compare app to the root package.json in the API. We already discussed
some of the details of how we might achieve this when going over the
Dockerfile stuff.
Other than that, I think this is basically good to go. I noticed some
checkboxes are out of alignment (at least for me, Firefox on Linux), but
that's it. It's really nice!.
[image: Screenshot_2020-03-03_18-30-30]
<https://user-images.githubusercontent.com/111716/75839377-8d3b7280-5d7d-11ea-8461-8af40bc0935e.png>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<pelias/compare#21?email_source=notifications&email_token=AADMZMDYIJIO23EFVXU5WTDRFW42FA5CNFSM4LAA343KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENWB7ZY#issuecomment-594288615>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADMZMGEWLPBCHWWK4YIZTTRFW42FANCNFSM4LAA343A>
.
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
|
Oh, I thought of another way we could manage things. This repository can publish an NPM module, which would contain only the compiled output for the compare app, and not the entire vue toolchain. Then we can either run that NPM module independently, to keep the current compare app on GitHub pages, or we can include it as a regular dependency in the API. We already use NPM modules for Pelias dependencies so this would fit well with existing patterns. Let me know if you think that works and we can set it up together. |
oh sweet, that's a good idea, and also one that I don't actually have a
great mental model of how to implement (how does one serve/bundle in html
from an npm module? no idea but there's likely a pattern out there), but
I'm sure I/we can figure it out.
I'll spend some time looking into this today, unless you off the bat have
an idea of what the publishing chain looks like.
…On Wed, Mar 4, 2020 at 1:46 PM Julian Simioni ***@***.***> wrote:
Oh, I thought of another way we could manage things. This repository can
publish an NPM module, which would contain only the compiled output for the
compare app, and not the entire vue toolchain. Then we can either run that
NPM module independently, to keep the current compare app on GitHub pages,
or we can include it as a regular dependency in the API.
We already use NPM modules for Pelias dependencies so this would fit well
with existing patterns. Let me know if you think that works and we can set
it up together.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<pelias/compare#21?email_source=notifications&email_token=AADMZMCPA7BD3HHJKZMATSLRF2OZ7A5CNFSM4LAA343KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENZRHBQ#issuecomment-594744198>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADMZMHMZ7BRUVQHWVVCNODRF2OZ7ANCNFSM4LAA343A>
.
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
|
Yup, I would imagine it would work well with some combination of npm scripts (maybe |
well ... that was easier than expected this is the change to serve it from api/ it's a 1.6mb zipped / 6mb unzipped dependency. I'm okay with always including it, in a separate PR we can talk about that. For this repo/PR
|
Cool, glad it was easy to set up the NPM module thing. Can you add the pelias NPM user as an admin on the module? Is it possible at all to have a build step with GitHub pages? I haven't gotten too in depth with it in a long time. As for what to do with this PR, I think we can move the current |
- fix options column display in firefox - explicit .nojekyll for github pages - don't auto-submit on autocomplete
re: display issue - fixed |
Awesome. Peter and I thought of some more things to take care of before merging this. The most important is that we ensure existing compare app URLs don't break. We probably have thousands of them in issues across the project and the internet at large, many of them come with screenshots of current results, so we might actually stand a chance at being able to do this. More specifically, Pelias supports several endpoints besides search and autocomplete. While we don't need to have specific handling for them, they should at least work by manually typing in a query. Again, the massive set of existing links could be useful here. Here's a rough list of the most important things:
|
sounds good, will test all the other endpoints I can find. I think they
should work as of now but will do some serious testing.
Was also thinking today about if/how/why I want to extend this for reverse
…On Thu, Mar 5, 2020 at 12:12 PM Julian Simioni ***@***.***> wrote:
Awesome.
Peter and I thought of some more things to take care of before merging
this.
The most important is that we ensure existing compare app URLs don't
break. We probably have thousands of them in issues across the project and
the internet at large, many of them come with screenshots of current
results, so we might actually stand a chance at being able to do this.
More specifically, Pelias supports several endpoints besides
<https://github.com/pelias/documentation#endpoint-descriptions> search
and autocomplete. While we don't need to have specific handling for them,
they should at least work by manually typing in a query. Again, the massive
set of existing links could be useful here.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<pelias/compare#21?email_source=notifications&email_token=AADMZMDHDI75Y3EBNHWWVKDRF7MOHA5CNFSM4LAA343KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN6DN7Q#issuecomment-595343102>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADMZMDTK7ERUL657IMF7NLRF7MOHANCNFSM4LAA343A>
.
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
|
Is it possible to maintain the existing copy->paste behaviour? The current CSS is a bit of a hackjob so copy->paste works nicely and it still renders ok.
|
Possibly off-topic considering the discussion of keeping the existing urls still working... Considering an API request as such: It would be ideal if you could send the exact same request but to another domain, say The nice thing about that approach is that the user can literally just change the hostname to switch between a GUI and the JSON API. |
re: css - I was wondering why there was that weird CSS for creating a
numbered list. Will put it back.
re: domain - would actually be really trivial to deploy this code to google
(or any other host that easily supports SPAs), almost entirely unmodified
as an SPA and it would do exactly that. Pretty sure we could put it on any
of the hosting services for free to get that behavior. Happy to work on
that after we land this?
…On Thu, Mar 5, 2020 at 2:33 PM Peter Johnson ***@***.***> wrote:
Possibly off-topic considering the discussion of keeping the existing urls
still working...
Considering an API request as such:
GET /v1/autocomplete?text=foo
It would be ideal if you could send the *exact same request* but to
another domain, say ui.geocode.earth instead of api.geocode.earth and it
displayed a UI such as this instead of serving JSON.
The nice thing about that approach is that the user can literally just
change the hostname to switch between a GUI and the JSON API.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<pelias/compare#21?email_source=notifications&email_token=AADMZMAUPETIE5ONR522OWDRF747JA5CNFSM4LAA343KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN6S6OA#issuecomment-595406648>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADMZMDU5ESDTFWMQZSR6YDRF747JANCNFSM4LAA343A>
.
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
|
Yes that depends if you're aiming for a framework refactor with backwards compatibility (to run on the same domain) or creating a replacement that would have a different url structure which we could forward rewritten requests to? I'm happy with either, but considering you've already spent more time on it than we did on the angular version, a new domain would allow you more flexibility to be creative. We would always have the opportunity to forward requests off the GitHub 'compare' url to another location once it was stable, thereby making it the default UI. Just a thought, maybe it's easier to chat on a video call about this? I don't want to be a blocker, just thinking what a v2.0 would look like rather than a v1.1 |
Hey Peter, all sounds good.
I'm going to work a bit today on the two big requests - css fix and full
backwards compatibility. I still think there's a relatively easy way to
have a unified codebase that can be both on server as well as independently
hosted *and* have full backwards compat.
At the end of the day, it's more important to me & my workflow to get a
version that's embedded on the api servers and to start actually digging
into some ranking challenges.
Let's chat after the next round of revs?
…On Fri, Mar 6, 2020 at 4:26 AM Peter Johnson ***@***.***> wrote:
Yes that depends if you're aiming for a framework refactor with backwards
compatibility (to run on the same domain) or creating a replacement that
would have a different url structure which we could forward rewritten
requests to?
I'm happy with either, but considering you've already spent more time on
it than we did on the angular version, a new domain would allow you more
flexibility to be creative.
We would always have the opportunity to forward requests off the GitHub
'compare' url to another location once it was stable, thereby making it the
default UI.
Just a thought, maybe it's easier to chat on a video call about this?
I don't want to be a blocker, just thinking what a v2.0 would look like
rather than a v1.1
Just a thought.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<pelias/compare#21?email_source=notifications&email_token=AADMZMBZ2ILZDES6SUITNB3RGC6TFA5CNFSM4LAA343KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOAVVUQ#issuecomment-595679954>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADMZMG6ZF3NXDFBKQR4PTDRGC6TFANCNFSM4LAA343A>
.
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
|
- support all five major pelias api endpoints + customize form for them - decode uri-encoded location hashes - pelias favicon - hack list css to make copy paste better - show focus point in modal - start of work on SPA version that uses url routing not hash
Okay, so!
here's the latest hosted version:
http://dump.blackmad.com/pelias-compare5/#/v1/search?text=london&debug=1
- does the css copy/paste hack
- implements custom modes for all five endpoints that I know of
- correctly understands searches from location.hash both with and without
url encoding
- uses the pelias logo for favicon ;-)
I'd really like to put this to bed soon if possible.
I'm ... 95% of the way to being able to do a full SPA version at a custom
domain like you had suggested too. works locally, not in prod, story of my
life :-/
…On Fri, Mar 6, 2020 at 11:46 AM David Blackman ***@***.***> wrote:
Hey Peter, all sounds good.
I'm going to work a bit today on the two big requests - css fix and full
backwards compatibility. I still think there's a relatively easy way to
have a unified codebase that can be both on server as well as independently
hosted *and* have full backwards compat.
At the end of the day, it's more important to me & my workflow to get a
version that's embedded on the api servers and to start actually digging
into some ranking challenges.
Let's chat after the next round of revs?
On Fri, Mar 6, 2020 at 4:26 AM Peter Johnson ***@***.***>
wrote:
> Yes that depends if you're aiming for a framework refactor with backwards
> compatibility (to run on the same domain) or creating a replacement that
> would have a different url structure which we could forward rewritten
> requests to?
>
> I'm happy with either, but considering you've already spent more time on
> it than we did on the angular version, a new domain would allow you more
> flexibility to be creative.
>
> We would always have the opportunity to forward requests off the GitHub
> 'compare' url to another location once it was stable, thereby making it the
> default UI.
>
> Just a thought, maybe it's easier to chat on a video call about this?
>
> I don't want to be a blocker, just thinking what a v2.0 would look like
> rather than a v1.1
>
> Just a thought.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <pelias/compare#21?email_source=notifications&email_token=AADMZMBZ2ILZDES6SUITNB3RGC6TFA5CNFSM4LAA343KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOAVVUQ#issuecomment-595679954>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADMZMG6ZF3NXDFBKQR4PTDRGC6TFANCNFSM4LAA343A>
> .
>
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
|
SPA version here:
https://pelias-compare.firebaseapp.com/v1/search?text=london&debug=1
…On Fri, Mar 6, 2020 at 2:00 PM David Blackman ***@***.***> wrote:
Okay, so!
here's the latest hosted version:
http://dump.blackmad.com/pelias-compare5/#/v1/search?text=london&debug=1
- does the css copy/paste hack
- implements custom modes for all five endpoints that I know of
- correctly understands searches from location.hash both with and without
url encoding
- uses the pelias logo for favicon ;-)
I'd really like to put this to bed soon if possible.
I'm ... 95% of the way to being able to do a full SPA version at a custom
domain like you had suggested too. works locally, not in prod, story of my
life :-/
On Fri, Mar 6, 2020 at 11:46 AM David Blackman ***@***.***>
wrote:
> Hey Peter, all sounds good.
>
> I'm going to work a bit today on the two big requests - css fix and full
> backwards compatibility. I still think there's a relatively easy way to
> have a unified codebase that can be both on server as well as independently
> hosted *and* have full backwards compat.
>
> At the end of the day, it's more important to me & my workflow to get a
> version that's embedded on the api servers and to start actually digging
> into some ranking challenges.
>
> Let's chat after the next round of revs?
>
> On Fri, Mar 6, 2020 at 4:26 AM Peter Johnson ***@***.***>
> wrote:
>
>> Yes that depends if you're aiming for a framework refactor with
>> backwards compatibility (to run on the same domain) or creating a
>> replacement that would have a different url structure which we could
>> forward rewritten requests to?
>>
>> I'm happy with either, but considering you've already spent more time on
>> it than we did on the angular version, a new domain would allow you more
>> flexibility to be creative.
>>
>> We would always have the opportunity to forward requests off the GitHub
>> 'compare' url to another location once it was stable, thereby making it the
>> default UI.
>>
>> Just a thought, maybe it's easier to chat on a video call about this?
>>
>> I don't want to be a blocker, just thinking what a v2.0 would look like
>> rather than a v1.1
>>
>> Just a thought.
>>
>> —
>> You are receiving this because you authored the thread.
>> Reply to this email directly, view it on GitHub
>> <pelias/compare#21?email_source=notifications&email_token=AADMZMBZ2ILZDES6SUITNB3RGC6TFA5CNFSM4LAA343KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOAVVUQ#issuecomment-595679954>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AADMZMG6ZF3NXDFBKQR4PTDRGC6TFANCNFSM4LAA343A>
>> .
>>
>
>
> --
> *David Blackman*
> creative technologist & wandering
> help me find my purpose <http://purpose.blackmad.com>
>
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
|
Awesome. It looks really good! Peter, I love your suggestion of being able to have a domain that handles Pelias URLs, but with the compare app. I think since David has put the core of the new compare app in an NPM module, we can build that. The main use of the NPM module will be to embed the compare app in the API. So it might be able to exist there. Alternatively we could create Yet Another Thing(tm) that also uses the compare NPM module to achieve that goal. I think we can follow up with it separately. David if you think the URL handling is reasonably solid and compatible with whats out there, the NPM module is ready, and you are ready to hit merge (or rather figure out a more git repo friendly way to bring this in), let me know and we can coordinate on that. Thanks for all the work on this! |
On Fri, Mar 6, 2020 at 2:10 PM Julian Simioni ***@***.***> wrote:
Awesome. It looks really good!
Peter, I love your suggestion of being able to have a domain that handles
Pelias URLs, but with the compare app. I think since David has put the core
of the new compare app in an NPM module, we can build that.
---> this is done, see https://pelias-compare.firebaseapp.com/, it's a
matter of building the "build:spa" build target and serving it from an SPA
enabled host. Like I said, firebase is super easy (and you can obviously
domain alias it)
The main use of the NPM module will be to embed the compare app in the
API. So it might be able to exist there. Alternatively we could create Yet
Another Thing(tm) that also uses the compare NPM module to achieve that
goal. I think we can follow up with it separately.
---> already have a like five line PR for api to do this. main thing to
figure out with you is if we need to make it optional (it's only a 1.5mb
package and obviously simpler to just always grab it)
David if you think the URL handling is reasonably solid and compatible
with whats out there, the NPM module is ready, and you are ready to hit
merge (or rather figure out a more git repo friendly way to bring this in),
let me know and we can coordinate on that. Thanks for all the work on this!
---> url handling: I feel pretty good, I also feel pretty sure someone will
find something broken and I will fix it.
---> npm: just pushed 0.1.5
---> git repo: if you're not wedded to the current history, I really think
maybe rename the existing repo to compare-old, and we start from scratch
with this one.
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<pelias/compare#21?email_source=notifications&email_token=AADMZMHHOMDCI5RT6Q6IH2DRGFDC3A5CNFSM4LAA343KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOCPNUQ#issuecomment-595916498>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADMZMFR3Q464K4ZQ5A7VR3RGFDC3ANCNFSM4LAA343A>
.
--
*David Blackman*
creative technologist & wandering
help me find my purpose <http://purpose.blackmad.com>
|
Okay great. We don't care about the history in this project, and we even already have a dedicated place for dead code to live. I'll move this entire repo to |
Benefits of this rewrite
Here's a link to the compiled output
http://dump.blackmad.com/pelias-compare2/dist/#/v1/search?text=london&debug=0