A place to cache linked articles (think custom and personal wayback machine)
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.md 8.6KB

il y a 4 ans
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. title: The State Of Meteor Part 2: What Happens Next
  2. url: https://www.discovermeteor.com/blog/the-state-of-meteor-part-2-what-happens-next/
  3. hash_url: c42e26d79ef2a72748850ca7d7f98d64
  4. <p>In my <a href="https://www.discovermeteor.com/blog/the-state-of-meteor-part-1-what-went-wrong/">last article</a>, I talked about the current state of Meteor and some of the things that have been holding it back. </p>
  5. <p>There’s reason to be hopeful, though. Indeed, I believe that while all this effort might’ve fell short of changing the world of web development, it did lay the groundwork for the <em>true</em> Meteor revolution. </p>
  6. <div class="note"><p><em>Please note that the views presented here are purely my own, and are not endorsed in any way by either Tom Coleman or the Meteor Development Group. I don’t work for or with MDG, and do not take part in the development of Meteor in any way.</em></p>
  7. </div>
  8. <h3>The Rise Of React</h3>
  9. <p>In the JavaScript world, the big story of the past few years has been the rise of the React ecosystem. </p>
  10. <p>In many ways, React’s trajectory reminds me of jQuery’s. After years of debating the merits of Dojo, Mootools, ExtJS, and countless other libraries, the web development world finally settled on jQuery. It wasn’t necessarily the most powerful, comprehensive, or performant library, but it was focused on doing its job well and everybody was glad to finally agree on a common standard.</p>
  11. <p>Similarly, while <a href="http://emberjs.com/">Ember</a> and <a href="https://angularjs.org/">Angular</a> might do more, and <a href="http://vuejs.org/">Vue</a> or <a href="http://mithril.js.org/">Mithril</a> might be more lightweight, React is a well-regarded, good-enough solution that works for almost everybody, and has a serious shot at establishing itself as the new standard in front-end frameworks. </p>
  12. <p>This is important because development standards are a winner-takes-all game: once jQuery became the default, it enabled an explosion of plugins and components built on top of it, and every JavaScript widget became a <em>jQuery</em> widget. </p>
  13. <p>The exact same thing might very well happen with React. And that’s a very exciting thing for Meteor.</p>
  14. <h3>The Reactification of Meteor</h3>
  15. <p>Officially, Meteor supports three front-end frameworks: Blaze, React, and Angular. But Blaze (no matter how much we like it) is probably not going to stick around forever. And Angular is… well, it’s not React. </p>
  16. <p>This might be a bit controversial, but I think the path that makes the most sense for Meteor is to drop any pretense of neutrality, and whole-heartedly embrace the React ecosystem.</p>
  17. <p>This is already happening. A sizable part of the Meteor community (<a href="https://www.discovermeteor.com/category/blaze-to-react/">myself included</a>) is currently migrating towards React. Not because we don’t like Blaze, but because using React means being part of something bigger.</p>
  18. <p>And there’s even talk of one day replacing core parts of Meteor like Tracker or Minimongo with their React alternatives. Who knows, maybe <a href="https://learngraphql.com/">GraphQL</a> will be the way we finally get support for other databases baked into Meteor?</p>
  19. <h3>The Cure To JavaScript Fatigue</h3>
  20. <p>Of course, the question that everybody then asks is: “but wait, if we end up using React, Relay, and GraphQL, what do we even need Meteor for anymore?”.</p>
  21. <p>The answer in a nutshell: as the cure to <a href="https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4#.b1eebexts">JavaScript fatigue</a>.</p>
  22. <p>Right now, using React requires cobbling together multiple bricks: React itself, its plugins, Webpack, some kind of data management system, to say nothing of a whole back-end stack. But Meteor is in a unique position to solve that challenge for you, and in essence become the best possible platform to build React apps. </p>
  23. <p>This all boils down to one key fact: Meteor is the only framework that controls the <em>whole stack</em>. </p>
  24. <h3>Server-Aware Components</h3>
  25. <p>Whenever I introduce Meteor to someone new, I have to explain that unlike React or Angular, it’s a <em>full-stack</em> framework. </p>
  26. <p>As I said in <a href="https://www.discovermeteor.com/blog/the-state-of-meteor-part-1-what-went-wrong/">part 1</a>, this turned out to be somewhat of a double-edged sword, as it also made switching to Meteor much harder compared to simply swapping out your front-end. </p>
  27. <p>But this liability turns into a huge asset when using Meteor <em>with</em> React. This is because Meteor is the best platform out there to build <strong>server-aware React components</strong>. </p>
  28. <p>The Meteor community has been spoiled with full-stack components like <a href="https://github.com/aldeed/meteor-autoform">Autoform</a>, <a href="https://github.com/meteor-useraccounts/core">UserAccounts</a>, or <a href="https://github.com/aldeed/meteor-tabular">Tabular</a> for years. Just add the package, and you not only get both the server and client components, but also the key <strong>server-client data management layer</strong>. </p>
  29. <h3>Meteor To The Rescue</h3>
  30. <p>This is in stark contrast with the rest of the JavaScript world, who can’t even <em>dream</em> of such components. A great example of this is Facebook’s own <a href="https://facebook.github.io/fixed-data-table/example-filter.html">FixedDataTable</a> component. </p>
  31. <p>Notice how the demo talks about “<strong>Client-side</strong> filter and “<strong>Client-side</strong> sort”? The documentation just assumes you’ll load <em>all</em> your data in memory and filter directly on the client. While server-side filtering and sorting may be possible, they’re treated like edge cases. And the same goes for similar components like <a href="https://github.com/glittershark/reactable">Reactable</a>.</p>
  32. <p>Contrast this with Tabular or <a href="https://github.com/aslagle/reactive-table">Reactive Table</a>: in the equivalent Meteor components, it’s a given that some of your data will remain on the server, and that the component will help you manage it. </p>
  33. <p>This is possible because Meteor being full-stack means developers don’t have to aim for a moving target. We know what APIs are available both on the client and server, and how to connect the two. </p>
  34. <p>The best part: React developers can keep writing back-end-agnostic components. As long as they expose the necessary APIs, we can just write Meteor wrappers to magically transform them into full-stack components!</p>
  35. <p>In fact, I’m putting my code where my mouth is, and lately I’ve been working on such a wrapper for <a href="https://github.com/meteor-utilities/Meteor-Griddle">Griddle</a>.</p>
  36. <h3>Welcome To The Future</h3>
  37. <p>So this is my vision of the future of web development for 2016. React as a common front-end standard, and Meteor starting out as one of many possible back-end choices, but slowly becoming the one that just <em>makes sense</em>. </p>
  38. <p>For my vision to come true, a few things will need to happen: </p>
  39. <p><strong>First</strong>, the Meteor Development Group will need to provide a clear story about the best way to build Meteor apps. It might seem like supporting more front-end frameworks will attract more developers, but I believe splitting up the community in three will hurt it in the long run. That’s why initiatives like <a href="https://kadirahq.github.io/mantra/">Mantra</a> and the <a href="http://guide.meteor.com">Meteor Guide</a> are so important. Independently of their technical merits, they give the community a common target to organize around.</p>
  40. <p><strong>Second</strong>, MDG will need to get Meteor itself up to snuff. Thanks to Webpack, React developers are used to niceties like modules, hot reload, and code splitting, and they won’t adopt Meteor if it means giving that up. The upcoming Meteor 1.3 release is already a big step in the right direction, and I’m impatient to see what the future brings. </p>
  41. <p><strong>Third</strong>, we’ll need to fill the package void created by moving away from Blaze. Packages like Autoform and UserAccounts will either need to be migrated to React, or new solutions will need to be created. This will achieve the double goal of both encouraging existing Meteor developers to port their apps to React, and attracting React developers to the Meteor ecosystem. </p>
  42. <p>If we can manage all three, I believe Meteor will be in a great spot. And when I write my next “State Of Meteor” post one year from now, it’ll hopefully be much, much shorter!</p>
  43. <p><em>You may be wondering what all this means for Discover Meteor, and to be fair we’ve been wondering the same thing! We hope to have an answer for you very soon, so stay tuned.</em></p>