Aurelia Script - Isn't it supposed to be dead simple?

#1

I thought this was supposed to be “add a js script ref to your index.html and then start creating views and viewmodels”, but when I went to the Aurelia Script github, I see “NPM Install” blah blah (eyes glazing over).

Don’t get me wrong, I have done multiple projects for clients using Aurelia + Typescript, but wasn’t the idea of Aurelia Script to literally drop in a script ref and then rock? I thought the whole point was to NOT have to NPM install anything.

I have a legacy project, so I don’t want to add a bunch of complexity to it by adding in all that mess (meaning I don’t want to install an entire project structure in my pre-existing legacy project).
What I was looking for was something like Durandal… Knockout… Vue…

Am I missing something?

2 Likes
#2

May i know where you saw the instruction of npm install? There shouldnt be any. It is indeed what you said: add a script tag and go.

For example: online playground link of ui virtualization uses the script tag: https://github.com/aurelia/ui-virtualization

If you are using auscript on a legacy project, theres going to be a distribution that gives you easier time with es5, if all you care about is templating and binding either via enhance or static resources registration

1 Like
#3

He was talking about the readme on github repo.

3 Likes
#4

I have created a PR based on the feedback here, it’s at https://github.com/aurelia/script/pull/27

Thanks @JordanMarr and @huochunpeng

1 Like
#5

I searched for “aurelia script”, landed on the aurelia/script github page and saw “NPM INSTALL” immediately. Being one Guinness in, it violated my expectations of the most simple instructions possible (since simple is supposed to be the point here). So I guess you could say it failed the “one Guinness test”. :laughing:

My initial thought was, “maybe the NPM INSTALL thing is targeted at contributors, and is not required for potential users”. So I went to the first linked examples on codesandbox, copied and pasted the three files into my legacy asp.net mvc code base, and tried it out. Unfortunately, it didn’t work the first time because I did not specify the root as root: '/myvirtualdir/app.js'.

This morning I was able to apply the tiny bit of critical thought needed to solve the problem. I must say that this is awesome that this works as a drop-in script (esp. for my legacy project)!

I think I was expecting to see the most simple example (the first linked example) printed directly on the readme.md as three code blocks under a “Quick Start Example” header (or something like that). Having to click to another page and grok the format of codesandbox, as simple as it may be, was still an extra click into the world wide web.

It should also include a note instructing the user to make sure their “root” is setup correctly. Ex: root: '/myvirtualdir/app.js' (in case you are using IIS locally instead of some lightweight http listener).
The codesandbox examples could still be shown as links below the most simple example.

So to summarize, I tried this at the end of the day, and that definitely impacted the experience, but I’m happy to see that it was just a very small bump in the road.

1 Like
#6

If you are using auscript on a legacy project, theres going to be a distribution that gives you easier time with es5, if all you care about is templating and binding either via enhance or static resources registration

That sounds awesome! Is this a work-in-progress?

1 Like
#7

Its already merged. Just waiting for @EisenbergEffect to release it. You can check the 2nd latest PR in the script repo.

About your case, i would be so nice if you could help adding some more text to the readme to help future devs.