DEV Community

Cover image for JavaScript predictions for 2019 by npm

JavaScript predictions for 2019 by npm

Tomek Poniatowicz on March 20, 2019

The co-founder and CEO of npm during his lecture at the Node+JS Interactive 2018 event made some predictions about there direction the web developm...
Collapse
 
steveblue profile image
Stephen Belovarich • Edited

Sounds like a lot more of 2018 to me.

React sure does enjoy a lot of hype, but according to one recruiter I recently spoke to React only accounts for 7% of job requests flowing through their agency. Survey results, number of Github stars and npm downloads are not great metrics, especially when large corporations can host local npm registries. Does this graph include the downloads in various instances of Artifactory or other local npm registries? It is only a matter of time before React goes the way of the Do Do like other JavaScript libraries before it. The main reasons will most likely be resistance to change and failure to adopt web spec.

IMHO 2019 is the year of Web Components, as Microsoft Edge will be the last evergreen browser to adopt the Custom Elements v1 spec. Web Components largely make UI libraries based on component patterns obsolete, with the exception of how libraries like React make components stateful of course.

Why should a team in 2019 considering how to build UI components use React when a huge chunk of the API for developing a component is baked into the browser with Custom Elements v1? I recently built a micro library that makes Web Components stateful and the entire library bundles down to under 2.3Kb minified.

Collapse
 
sally profile image
Sally • Edited

"one recruiter I recently spoke to React only accounts for 7% of job requests flowing through their agency."

Tech stacks can cluster around particular hubs in different cities and countries. I'm in a MERN stack hub here, but in other places you might look at the local market and realise it's all LAMP or the front-end is vanilla JS and jQuery. Had a company present at my bootcamp who used Backbone with no plans to migrate away.

Trends change from place to place.

Collapse
 
revskill10 profile image
Truong Hoang Dung

Because I can do SSR with React. Single codebase for both backend and frontend.

Collapse
 
steveblue profile image
Stephen Belovarich

You can SSR Web Components too and still retain isomorphic JavaScript, hell you could use TypeScript on the front end and back end too.

Thread Thread
 
revskill10 profile image
Truong Hoang Dung

My use of React is because of two things:

  • React Hooks for logic.
  • React Suspense for data fetching.

How do Web Components support these patterns ?

Thread Thread
 
steveblue profile image
Stephen Belovarich • Edited

This isn’t a referendum against your use of React. Use whatever library suits the project but be aware JavaScript libraries come and go but W3C spec tends to stick around. Div still going strong after all these years!

Thread Thread
 
steveblue profile image
Stephen Belovarich

But to answer your questions, Custom Elements still have lifecycle hooks and well fetch API is available in evergreen browsers.

Collapse
 
seanmclem profile image
Seanmclem

How do you import your library into your web component? By leveraging webpack?

Collapse
 
steveblue profile image
Stephen Belovarich

What exactly do you mean? If the library is distributed as esm, you would just import the methods you need with import. If the library is distributed as commonjs, you require them. A bundler like Webpack, Rollup, Parcel, or SystemJS would be needed to bundle everything together just like any other JavaScript project.

Collapse
 
andrzejchmura profile image
Andrzej Chmura

Somebody on your team will bring in TypeScript ...

I guess that’s me 🤷‍♂️

Collapse
 
nepeckman profile image
nepeckman

I'm a little confused how a 0.005% registry share implies that 2019 is the year of GraphQL. If we extrapolate from some other numbers in the study (React has 0.05% registry share and 60% market share among frameworks) we can gather that about 6% of developers using a framework are also using GraphQL (assuming everyone using GraphQL is using some framework). It seems like this study is seriously overhyping the prominence of GraphQL, and I'm not convinced it'll hit mainstream this year or next.

Collapse
 
imm9o profile image
Islam Muhammad • Edited

React is a great framework but that doesn't mean it will be the dominant framework based on the number of downloads or GitHub stars, not a valid metric.

I think 2019 is the year of web components and that doesn't mean it will make frameworks obsolete, the reason why I think that check this link for more The deepest reason why modern JavaScript frameworks exist

Collapse
 
suntong profile image
suntong • Edited

web components doesn't make frameworks obsolete because

"Web components do not provide a solution to this problem (keeping the UI in sync with the state)"

Gotya. thx.

Collapse
 
alanbosco profile image
Alan Bosco

What about Vue.js? it's getting more traction every month. What do you think about it?

Collapse
 
tomekponiat profile image
Tomek Poniatowicz

Agree, Vue seems to be a solid alternative to React.

Collapse
 
toastking profile image
Matt Del Signore

I think next year will be the year Typescript really explodes in popularity. Especially with Vue being rewritten in Typescript.

Collapse
 
osde8info profile image
Clive Da

i am sure you are right about graphql (btw i havent a clue what it is) but it is popping up in 50% of all my searches for node / express / react / apis so its at the top of my todo list