These are chat archives for ractivejs/ractive

7th
Sep 2017
Joseph
@fskreuz
Sep 07 2017 12:17
Any good recommendations for modern test runners/tools/things that make setting up and writing browser JS unit tests easier?
Nothing wrong with Karma+QUnit+Phantom (which Ractive uses perfectly fine). Just wondering if there's any new innovations in terms of unit testing in a browser-like environment.
lazylester
@lazylester
Sep 07 2017 13:23
Anyone else running into probs with phantomjs? I'm upgrading my project from Ractive 0.7.3 to 1.0.0 build 9 and seeing "Promise not found" issues. Others seeing this?
Joseph
@fskreuz
Sep 07 2017 13:24
1.x should have a Promise polyfill built in. Can you provide the stack trace?
Also provide browser details and plugins used.
lazylester
@lazylester
Sep 07 2017 13:26
How can I get a stack trace from phantomjs. Sorry, I should be smarter!
Joseph
@fskreuz
Sep 07 2017 13:26
oh :facepalm: I need coffee...
But I'm confused tho. How exactly are you getting the error? Are you building locally? How is your project involved with PhantomJS?
lazylester
@lazylester
Sep 07 2017 13:30
I just downloaded the pre-built version from the cdn.
phantomjs is used for my front-end testing of a RubyonRails app with Rspec/Capybara
At least, it was until Ractive 1.0.0 build9
Am I doing something stupid? It's quite possible!
Joseph
@fskreuz
Sep 07 2017 13:33
Aha! So prebuilt Ractive + your instance of Phantom. I was thinking Ractive's PhantomJS stuff and thought you're building locally.
Hmm...
But still, the error is strange.
lazylester
@lazylester
Sep 07 2017 13:35
So I take it that you're not seeing the error, Joseph?
Joseph
@fskreuz
Sep 07 2017 13:37
Hard to tell without a trace. Ractive comes with its own Promise polyfill (and applies it globally if no Promise global is found) so I can't see how Ractive (or any code after it) could break with that error.
lazylester
@lazylester
Sep 07 2017 13:39
I didn't know how to troubleshoot it, so I switched to chrome as a workaround.
kouts
@kouts
Sep 07 2017 13:39
Maybe you have code that expects Ractive.Promise?
Joseph
@fskreuz
Sep 07 2017 13:39
Ahh, in that case, it could break.
kouts
@kouts
Sep 07 2017 13:39
Doing Ractive.Promise = Promise; will solve it.
lazylester
@lazylester
Sep 07 2017 13:43
I'm pretty sure I'm not using Ractive.Promise anywhere in my own code. But maybe there's an interaction with my test libs (mocha).
Joseph
@fskreuz
Sep 07 2017 13:43
If you can enumerate the plugins you use (if any), we can tell. :grin:
lazylester
@lazylester
Sep 07 2017 13:44
what plugins do you mean?
Joseph
@fskreuz
Sep 07 2017 13:44
loaders, transitions, decorators, etc. Some of them are known to use Ractive.Promise.
lazylester
@lazylester
Sep 07 2017 13:48
I see a 'slide' transition, that I think came from Rich Harris, and it appears to use some promise behaviour.
Joseph
@fskreuz
Sep 07 2017 13:50
Doesn't look like it uses it. At any rate, try @kouts 's suggestion.
Chris Reeves
@evs-chris
Sep 07 2017 13:51
1.0.0-build-9 is pretty old
it may predate pulling the promise polyfill back in the main distribution, but my memory is awfully fuzzy
looks like current is build-64
Joseph
@fskreuz
Sep 07 2017 13:53
lol, didn't know it was that far ahead already :grin:
lazylester
@lazylester
Sep 07 2017 13:54
wow, where can I find it?
Joseph
@fskreuz
Sep 07 2017 13:54
The jsdelivr CDN has it
Chris Reeves
@evs-chris
Sep 07 2017 13:55
yep, also on npm
lazylester
@lazylester
Sep 07 2017 13:56
what is the index page on jsdelivr that shows me the list of available builds?
Chris Reeves
@evs-chris
Sep 07 2017 13:56
and the build branch at GitHub has dists
There's a dropdown on the top right.
Chris Reeves
@evs-chris
Sep 07 2017 13:58
also, if you just throw @edge as the tag, it will automatically pull the latest build
lazylester
@lazylester
Sep 07 2017 14:01
Great, thanks. I'll try that. I missed the dropdown. Don't we need a link on the homepage?
Oh I see, the homepage link is missing the trailing /
that's the key to finding the source!
Joseph
@fskreuz
Sep 07 2017 14:04
When you mentioned CDN, you meant https://cdnjs.com/libraries/ractive (whose default selection is build 9)?
(not exactly sure how they select the default)
Martin Kolárik
@MartinKolarik
Sep 07 2017 14:06
if you don't use natsort, 9 is the highest number in there, so "latest version"
lazylester
@lazylester
Sep 07 2017 14:06
Well I'm not really sure which CDN I used, but I see that the jsdelivr link is missing the critical trailling backslash so I just sent a PR
Martin Kolárik
@MartinKolarik
Sep 07 2017 14:07
the link on homepage is meant to link to the latest stable build, so it's correct
lazylester
@lazylester
Sep 07 2017 14:08
but somewhere there needs to be a pointer to a list of all builds, no? I never could find one.
Martin Kolárik
@MartinKolarik
Sep 07 2017 14:09
probably yes but not sure if there
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:09
@MartinKolarik it's so confusing that the page behaves very different with a trailing slash, as @lazylester points
would you consider a distinct postfix for the raw builds, like /raw?
Joseph
@fskreuz
Sep 07 2017 14:10
It kinda makes sense since a / is short for /index.html, is it?
Martin Kolárik
@MartinKolarik
Sep 07 2017 14:11
in general most projects show direct links to latest files, which is what Ractive does, and another link to jsdelivr project page, where you have all versions and other info: https://www.jsdelivr.com/package/npm/ractive (which ractive doesn't have anywhere)
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:11
or the reverse, package and package/ will point to the raw file and the /index and /index/ will show the html
Martin Kolárik
@MartinKolarik
Sep 07 2017 14:13
@ceremcem that isn't something we can change
lazylester
@lazylester
Sep 07 2017 14:13
There are several ways, but really nothing needs to change, we just need a link on the home page.
Martin Kolárik
@MartinKolarik
Sep 07 2017 14:13
we should just add a link to the listing page somewhere in Ractive website/readme
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:17
@fskreuz that's true, but it's still very confusing. I would expect ractivejs.org/playground to lead me to the playground, not the ractive home page
I would only care about the trailing slash with rsync
Joseph
@fskreuz
Sep 07 2017 14:19
I have no admin on ractivejs.org and I think the redirect in place just points all paths on ractivejs.org to ractive.js.org.
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:22
my point is that it shouldn't be accepted as a normal behaviour, that's all. (everything will eventually be changed in the way it is accepted as normal)
lazylester
@lazylester
Sep 07 2017 14:29
@fskreuz responding to your earlier comment about trailing slash being short for index.html, note that www.jsdelivr.net/npm/ractive/index.html is a 404
Chris Reeves
@evs-chris
Sep 07 2017 14:31
it's a general thing from way back when Apache httpd was young and you see it in some restful docs as well
Joseph
@fskreuz
Sep 07 2017 14:31
Well... the idea is that a / is usually an implied index page (which is usually index.html, index.php or whatever extension the server supports). Some servers drop the file extension or filename altogether for clean urls. Stuff... stuff...
Chris Reeves
@evs-chris
Sep 07 2017 14:32
/foo is a thing and /foo/ is a directory/group of things
typically with an implied index served, but it's not required
oh mod_rewrite, how I don't miss your rules
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:33
so we may think foo as a file or a directory
Chris Reeves
@evs-chris
Sep 07 2017 14:33
by convention, yes
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:34
so, if foo is a file, /foo must show me the file and /foo/ would throw an exception
if foo is a directory, /foo/ will show its contents and /foo would not show anything other than /foo/ shows. doesn't it make sense?
lazylester
@lazylester
Sep 07 2017 14:35
the mapping from unix filesystem notation to urls is only Apache conventions, there aren't rules for this
As @evs-chris points out, it's configurable in httpd
Chris Reeves
@evs-chris
Sep 07 2017 14:36
more /foo(.html) and /foo/(index.html), which originated (I think, I have no experience with stuff predating Apache) with Apache httpd
it tends not to be tied to filesystems with more modern routing, but the general conventions stuck
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:40
hmm. so you're saying calling /foo might be considered as a shorthand for /foo(.html) and / directory may contain both /foo and /foo.html?
that may make sense, but it's very uncommon in unix world, so I would never guess that.
anyways. what about my PR's? why there is no pipe on them? :smile:
Joseph
@fskreuz
Sep 07 2017 14:42
https://en.wikipedia.org/wiki/Semantic_URL - this might be the thing we're all talking about.
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:45
hmm. right, as @evs-chris said
Chris Reeves
@evs-chris
Sep 07 2017 14:55
oh my, I haven't been watching the docs repo
I'll look at them when I get to a real machine
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:55
:smile:
Joseph
@fskreuz
Sep 07 2017 14:57
I'm also swamped myself so yeah... :grimacing:
Cerem Cem ASLAN
@ceremcem
Sep 07 2017 14:59
I was thinking that that might be because of my silly questions I asked lately :smile:
...and one more is on its way
Chris Reeves
@evs-chris
Sep 07 2017 20:49
@ceremcem thanks for the docs PRs!
@MartinKolarik I just got a chance to look through some more of the jsdelivr frontend, and I must say that it's quite lovely
Martin Kolárik
@MartinKolarik
Sep 07 2017 20:56
Chris Reeves
@evs-chris
Sep 07 2017 20:56
yeah, typoed on my phone :smile:
Martin Kolárik
@MartinKolarik
Sep 07 2017 20:58
yeah but I still can't decide whether I like more the www version or the clean and simple index page at cdn :D
Chris Reeves
@evs-chris
Sep 07 2017 20:58
both certainly have their uses
building up a url by selecting different packages on the www looks like it would be super helpful for those starting out
the cdn is nice and clean
Martin Kolárik
@MartinKolarik
Sep 07 2017 20:59
yes the link builder is also a great way to show all available features
Chris Reeves
@evs-chris
Sep 07 2017 21:04
wow, your npm search kicks the crap out of npm's search
Martin Kolárik
@MartinKolarik
Sep 07 2017 21:05
Algolia is really good at that
Chris Reeves
@evs-chris
Sep 07 2017 21:06
if you're up for suggestions, my only one would be to extend searching to the individual package pages so that it's even easier to build up an aggregated lib link
Martin Kolárik
@MartinKolarik
Sep 07 2017 21:08
that might be a good idea
Chris Reeves
@evs-chris
Sep 07 2017 21:08
is the yearly hit stat an extrapolation?
Martin Kolárik
@MartinKolarik
Sep 07 2017 21:09
I also noticed this got a little harder, our old website had file listing directly in search results, so you didn't have to jump between pages all the time
yeah currently it's all based on last 7 days
since we only have data for ~20 days
Chris Reeves
@evs-chris
Sep 07 2017 21:13
ah, that would also resolve the difference from the badge to the monthly stat? I thought vue was bigger than it is, but it's truly dwarfed by react and angular
I suppose another cdn may be more popular for certain libraries, but still... orders of magnitude
Martin Kolárik
@MartinKolarik
Sep 07 2017 21:14
yes, badge has the real number
vue currently recommends unpkg as the official cdn
then again, so does react :D
Joseph
@fskreuz
Sep 07 2017 21:15
Screen Shot 2017-09-07 at 4.59.26 PM.png
I wonder what happened there...
Martin Kolárik
@MartinKolarik
Sep 07 2017 21:16
Google started indexing our website
Joseph
@fskreuz
Sep 07 2017 21:17
:grimacing: dem bots.
Martin Kolárik
@MartinKolarik
Sep 07 2017 21:38
we have a sitemap (10 sitemaps, actually) for all npm packages, so that's about 500k pages :D