Better HN
topnewbestaskshowjobs
Log inSign up

piercey4

68 karma · joined Jan 31, 2016 (10y ago) · 38 submissions

Submissions

comment 1y ago · link · parent

FYI in an actual editor the syntax highlighting works. In the (new) website it's using a different highlighter which has issues. Will be fixed soon!

comment 1y ago · link · parent

Marko can! It's "define" tag lets you create reusable templates in your reusable templates.

https://markojs.com/docs/reference/core-tag#define

3.

The Marko Tags API Preview(dev.to ↗)

10 points · by piercey4 · 5y ago · 3 comments

4.

eBay Launches Marko 5(medium.com ↗)

3 points · by piercey4 · 5y ago · discuss

5.

Sending a wasteful amount of code to the browser? Maybe there's a better way(medium.com ↗)

5 points · by piercey4 · 6y ago · discuss

6.

Show HN: Isomorphic, framework agnostic document (html/head/body) renderer(github.com ↗)

1 points · by piercey4 · 9y ago · discuss

7.

Show HN: JSize – Easily compare npm package size(github.com ↗)

1 points · by piercey4 · 9y ago · discuss

8.

'the' best validation library in JavaScript(github.com ↗)

3 points · by piercey4 · 9y ago · discuss

9.

How to make universal JavaScript applications – Part 1(medium.com ↗)

2 points · by piercey4 · 9y ago · discuss

10.

How to make universal JavaScript applications – Part 1(medium.com ↗)

1 points · by piercey4 · 9y ago · discuss

11.

Show HN: Rill – The Express style router for the browser(github.com ↗)

1 points · by piercey4 · 9y ago · discuss

12.

Show HN: Rill – The universal/isomorphic router for modern JavaScript(rill.site ↗)

4 points · by piercey4 · 10y ago · 1 comment

13.

Rill: lets you pretend that your browser is a fully capable Node.js server(github.com ↗)

1 points · by piercey4 · 10y ago · discuss

14.

Rill: lets you pretend that your browser is a fully capable Node.js server(github.com ↗)

1 points · by piercey4 · 10y ago · discuss

15.

Universal middleware framework for JavaScript(github.com ↗)

1 points · by piercey4 · 10y ago · discuss

comment 10y ago · link · parent

Caching can easily be shared, @rill/loader works perfectly for my needs. For everything else you are more or less correct. However like i've mentioned Rill works perfectly fine as a standalone server side framework or a standalone browser framework.

Everything you mentioned is achievable with Rill. I have found two simple ways to Isolate server only code in Rill.

1) Have two Rill servers, one with shared code and one without. Where the shared code server interacts with the isolated secure api from the other server.

2) Have one server that calls itself through http(s) requests where the api bits of the server and everything else you mention is hidden behind a "if (!process.browser)" statement. With browserify and other build tools you can have it automatically parse out any server side code. This is my preferred approach because I get to bundle all of the important parts of my app together while still having granular control over where things run.

comment 10y ago · link · parent

I mention my inspiration here: https://github.com/rill-js/rill/issues/12.

There are some other interesting frameworks that have come up while I was developing Rill such as https://github.com/catberry/catberry but I think (like many have said in this thread) that there is a fine balance to be had with isomorphic JavaScript. For example I really dislike meteor because I feel like I have little control. I like Rill because it is a perfectly capable backend framework, a perfectly capable front end framework and it all meshes together pretty well.

comment 10y ago · link · parent

As I have mentioned to others here and is mentioned in the Rill README the goal of Rill is provide a bare minimum of abstractions over the browser to encourage code sharing and code reuse with isomorphic JavaScript. Even with this goal Rill is great because you can use it "server only" or "client only" or shared, it's up to you, it gets out of the way. The huge benefit is that when you want to be able to share code it's extremely easy and when you don't just use "if (process.browser)" type stuff to clean up the edge cases.

Ultimately I found that when writing isomorphic SPA's the amount of code you "CAN" share is much more than what is unsharable, personally I am often able to share 90% or more of the front end code and just have to throw in a few "if (!process.browser)"'s to hide some mission critical stuff from the client.

With many isomorphic examples you will find you end up jumping through hoops to share code. Rill makes this part easy but that doesn't mean that absolutely everything can or should be shared.

comment 10y ago · link · parent

The way that I typically setup my apps is to have two parts of the server. Typically something like:

``` if (!process.browser) app.use(require('./api')) ```

Where the api is your typical REST based api with JWT auth tokens. Then the shared client side part of the api communicates with the secure part through "fetch" which works isomorphically (in the browser it is an ajax request, in the server it is a local http request to itself) you should checkout @rill/fetcher for what I currently use. In Rill there is no issue with having "client only" or "server only" routes, the main benefit is that the api is the same no matter where you are working. Take for example "@rill/progress" which is a progress bar that only does work in the browser, or "@rill/compress" which only does anything on the server or "@rill/logger" which works on both (although with completely different implementations). The goal is certainly to encourage code sharing where possible but to also not get in the way. You can use Rill as a standalone server only app if you want, or even just as an in browser framework, it doesn't really matter.

As for my example with emails it is certainly not real world and I don't recommend having public access to an email api but the point was merely to demonstrate that all of the code could be abstracted to work in either place (even without rill).

comment 10y ago · link · parent

What I use to handle state transfer from the server to the client is @rill/session along side @rill/loader. Check them out and feel free to ask me any questions (here or in the gitter!)

comment 10y ago · link · parent

I agree with you 100%. You can take this hammer and use it like a axe. But that's not the goal.

My personal setup has been to still separate my api (although still written in Rill) from all of this) which runs as an independent server. Then I have an isomorphic Rill instance communicate with that API. This way I still keep the important things separate.

comment 10y ago · link · parent

I use both but personally prefer Isomorphic because in most cases the code isn't actually universal, it has to be translated (shimmed, transpired, etc) between environments.

If there is one thing you can do to annoy programmers though is to use the wrong terminology :p.

comment 10y ago · link · parent

Yeah it's not a perfect word to describe what's going on. I think the loose definition I posted at the beginning of the article works well though.

comment 10y ago · link · parent

Great question. I personally use @rill/session along side @rill/loader. Basically on the initial page load @rill/session asks the server for the current session then for the rest of the users session the browser manages the data.

25.

Isomorphic JavaScript, let’s make it easier(medium.com ↗)

66 points · by piercey4 · 10y ago · 37 comments

26.

Simple html templates with es6 template tags(github.com ↗)

1 points · by piercey4 · 10y ago · discuss

27.

Isomorphic React made easy(github.com ↗)

2 points · by piercey4 · 10y ago · discuss

28.

Introducing Rill – the isomorphic, middleware based, web application framework(github.com ↗)

4 points · by piercey4 · 10y ago · discuss

29.

Show HN: React style diffing with plain old html(github.com ↗)

1 points · by piercey4 · 10y ago · discuss

30.

Free, automated HTTPS for Node.js made easy(github.com ↗)

2 points · by piercey4 · 10y ago · discuss

12