News for hackers. Stuff that matters.
Re:Ask HN: Fatigued by the complexity of ES6 tooling. What t... by laktek on Sunday March 12, 2017 @12:04AM (#13849100)
My recommendation is to start with just ES6 and Web APIs. Use DOM manipulation APIs to render page. You can use History PushState [0] and CustomEvents [1] to handle routing.

Only part you might have to spend some time to figure out would be compiling and module bundling. I suggest picking Webpack2 [2] and going through its guides to get up to speed with it.

Avoid frameworks and UI libraries like React and Vue until you really have a good grasp of the eco-system and problem you are trying to solve.

[0] https://developer.mozilla.org/en/docs/Web/API/CustomEvent

[1] https://developer.mozilla.org/en-US/docs/Web/API/History_API...

[2] https://webpack.js.org/guides/

Re:Ask HN: Fatigued by the complexity of ES6 tooling. What t... by scarface74 on Monday March 13, 2017 @12:50PM (#13859588)
Using DOM manipulation directly in code is a bad idea. It leads to an unmaintabke mess. At least use Handlebars.
Re:Ask HN: Fatigued by the complexity of ES6 tooling. What t... by slmyers on Sunday March 12, 2017 @12:30AM (#13849209)
> You can use History PushState [0] and CustomEvents [1] to handle routing.

Can you please expand on this?

Re:Ask HN: Fatigued by the complexity of ES6 tooling. What t... by laktek on Sunday March 12, 2017 @12:48AM (#13849274)
Sorry in a bit of rush as it's Sunday here, I will try to write a blog post with more detailed example later tonight.

For now, I will share this snippet:

  document.addEventListener('state-change', (ev) => {
    const { key, action } = ev.detail;
    const state = { key, action };
    window.history.pushState(state, null, `/${action}/${key}`);
    console.log(`triggered state change. action: ${action} key: ${key}`);
    return handleState(state);
  });

And then in your app code (for example, when a user clicks a button), trigger a state change:

  const event = new CustomEvent('state-change', {
   detail : {
    state: state,
    key: key
   }
  });
  document.dispatchEvent(event);
Re:Ask HN: Fatigued by the complexity of ES6 tooling. What t... by Siilwyn on Sunday March 12, 2017 @05:28PM (#13853225)
Hey just wanted to say thanks! Never heard of the `CustomEvent` API I [used it](https://github.com/AyriaPublic/desktop/commit/3e3b0ad76e7624...) in a small work in progress Electron app. ^^