Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A lot of Salesforce sites use react - including:

https://status.salesforce.com/

and ironically:

https://www.lightningdesignsystem.com/

Why do they insist on forcing their framework of the week on their dev community and make it much easier to bring your own framework? NIH syndrome? Lock in?

We use react and visualforce to get our products built but the visualforce requirement to do so is sub optimal.



At its core, Salesforce is a platform. As such, our customers expect their code to work for the long run (and backwards compatibility forever). Not owning the framework fundamentally means jeopardizing our business and our customers, since we can't control our future.

We believe the best way to future-proof our platform is to align with standards and help push the web platform forward, hence our sugar and take on top of Web Components.

Also to your comment about using different frameworks, again as a platform, allowing our customers to trivially include their framework choice of the day, will mean that we might end up having to load seven versions of react, five of Vue, 2 Embers .... You get the idea :) Outside the platform we love all the other frameworks (hence other properties might choose what it fits their use cases) and we had a lot of good discussions with framework owners about how to keep improving things over the last two years.

Our goal is to keep contributing to the standards and push all the things to be implemented natively on the platform so we all get faster and better.


So fork a sanctioned version of React or some other framework, why reinvent the wheel? Just fork it and call it ReSales or something like that, stick with the baseline and then if FB moves in a direction you don't like, then move your fork in the direction that best suits Salesforce.


> So fork a sanctioned version of React or some other framework

They have basically done that by making LWC a pure ES6 implementation. If you look at how one authors LWCs, then you'll see that you're very much at home if you have worked in React or Angular using JS or TypeScript. It's basically, conceptually the same as those other frameworks and all your JS experience applies.

The difference is all the styles and widgets that make their JS library (called Salesforce Lightning Design System (SLDS)), plus all the decorators and how they work.

Here's why I think that Salesforce should be praised for the direction they have taken in the last two years or so...

They have completely revamped and sped up the Lightning UI so that speed is not an issue anymore. They have also flattened their authoring environment to ES6. To get this done, they have taken the bold step of dumping their old Lightning (Aura) framework for this new LWC framework.

That means if you're an enterprise who's invested in the old Aura-based framework, you're basically screwed and now have a dead codebase. But, it also means that no one has to use that old, crappy framework anymore.

And, here's the most important thing that Salesforce has done to bolster it's own ecosystem. With Lightning Web Components, if you are looking for Salesforce devs, it's now a lot easier to hire SQL-savvy Javascript devs who can adapt their React experience to LWC.


> Not owning the framework fundamentally means jeopardizing our business and our customers, since we can't control our future.

Then why make the framework open source in the first place? The definition of open source is not owning the framework.


We all know that Facebook controls React and Google controls Angular and so on., similarly Salesforce will control LWC


that's the definition of free software, not open source. Open source just means you can view the code.


No, open source[1] and free software[2] are the same thing. The only difference is in philosophy of advocacy - the open source movement branched off from the free software movement because they wanted to emphasize the practical benefits rather than the ethical aspects (user freedom).

[1] https://opensource.org/osd

[2] https://www.gnu.org/philosophy/free-sw.html


That’s my point.


If you look at the definitions I linked to, you'll see that they are very similar to each other and both involve a lot more than "just means you can view the code".

In fact, the very first sentence of the introduction explicitly rejects your proposed definition: "Open source doesn't just mean access to the source code."


Sure, buddy


I guess because React insists on going against WebComponents, while everyone else is adopting them.

At least that is my understanding from Angular, Vue, Ionic, Svelte and plain VanilaJS point of view.


React can be used with web components if you want.

https://reactjs.org/docs/web-components.html

The big issue is browser support. According to caniuse, IE and Edge simply have zero support while Opera and Safari have only partial compliance. The current Firefox ESR doesn't support it either (behind a flag).

The polyfill incurs a big performance hit and a lot of devs need to support those browsers for several more years.


Edge support is perfectly fine, and it is going to be replaced by Chrome anyway.

Firefox, Safari and Chrome based browsers are perfectly fine.

Opera is based on Bink nowadays.

ESR is not something that I regularly see in the wild.

In any case, I was speaking that only see this anti-WebComponents attitude in the React community.


Safari doesn't support customized built-in elements, at all, and isn't going to. That is pretty far from being "perfectly fine".


I see all green here.

https://www.webcomponents.org/


https://caniuse.com/#search=web%20components

The Shadow DOM and Custom Elements are not that kind of green it should be.


That's silly, customized built-ins are not an essential feature. They are a nice to have. You can get by without ever using them, which is indeed what most people do. As does the subject of this discuss, the Lightning Web Components doesn't use that feature at all.


It also means, that you cannot use existing form controls for your custom element, you must build them up from scratch from divs, and relegate them into uncanny valley of not-quite-native, slightly-off elements.

Yes, it is possible to not use them; you can always make your life harder than necessary, you could also write an modern OS in assembly, for example, if you wanted to. If people are avoiding them today, one reason could be that they want their components to run in Safari.


Even if you aren't able to inherit from a form element, can't you still `createElement` one and add it inside your custom element? Surely they don't force you to reimplement <input /> from scratch!


Yes, you can compose them; and then implement a proxy that creates all the methods and attributes that given element class is supposed to have and forward them to the real implementation.

Busywork, so Apple can hold their position. How nice. No, it is not "perfectly fine".


Same here... I actually put maintain a starter project for react + VF: https://github.com/ChuckJonas/bad-ass-salesforce-stack

I don't see this changing much. Salesforce has a serious follow through problem. They tend to half-a$$ good ideas and then once they get the press for them, they stop investing in them.

Just tried the create-lwc-app and it didn't build finish properly




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: