
Open-sourcing the Lightning Web Components framework - kungfudoi
https://developer.salesforce.com/blogs/2019/05/introducing-lightning-web-components-open-source.html
======
tvanantwerp
I (thankfully) don't have to use Salesforce very often. But from my
experience, the Lightning Experience always felt non-performant compared to
the traditional server-rendered pages. Things always took a noticeable amount
of time to finish loading. Even though the traditional interface is, by
appearance alone, quite traditional, as least it felt fast. I don't know if
Lightning's problems were with poor performing front end code, or poor API
performance. But I was always underwhelmed when testing the SPA version of
Salesforce.

~~~
hliyan
I was using SFDC extensively when the Lightning experience first arrived, and
my experience tallies with yours. I ended up switching back to the old
experience to get my day to day work done.

~~~
tdviking21
Ugh, ya, I had to immediately switch back to the traditional. Lightning was so
slow.

------
miloandmilk
A lot of Salesforce sites use react - including:

[https://status.salesforce.com/](https://status.salesforce.com/)

and ironically:

[https://www.lightningdesignsystem.com/](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.

~~~
elfogris
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.

~~~
jefflombardjr
> 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.

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

~~~
ptx
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](https://opensource.org/osd)

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

~~~
dickeytk
That’s my point.

~~~
ptx
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."

~~~
dickeytk
Sure, buddy

------
kls
<template if:true={isTrueTemplate}> Sorry been down this road with Angular
before, logic in the template is a dumpster fire of a non-debug-able, bad
idea.

------
couchand
I haven't used it, but I'll try to summarize what I know for the folks asking
general questions.

"The Lightning Experience" generally is a set of related products and tools
from Salesforce. It's based on a live-updating model (as opposed to
Salesforce's old-style whole page refresh model) and has a new visual and UX
design system targeting mobile.

They're trying to bring everyone along to their new model, but they clearly
understand it will take a while: they've built an experience switcher in the
main menu and have invested heavily in adoption tooling.

If you want more specific info I'd suggest their training site Trailhead.
Here's the Lightning Web Components introduction:
[https://trailhead.salesforce.com/content/learn/modules/light...](https://trailhead.salesforce.com/content/learn/modules/lightning-
web-components-basics)

~~~
hajile
The honest truth is that Lightning Components are just vendor lock-in. Once
you buy into lightning, you wind up using their proprietary communication
channels and their proprietary component library (which this press release
makes clear isn't open sourced).

If you want to change backends to something better, you can't because while
the backend will port rather directly, the front-end will not.

Then there's also the fact (unless things have changed dramatically in the
past few months) that writing your front-end in Vue or React will result in
much faster UI experiences and finding developers to maintain it will be
easier and cheaper (Salesforce devs are generally a bit more expensive).

~~~
vips7L
I think the honest truth is that the only people going to be using LWC are
Salesforce developers on the Salesforce platform, they're already locked in.

------
iagooar
Question for the HN crowd: is your company using, or have you used Salesforce?
On what scale? What kind of business? Was it worth it? Did you enjoy the
experience? Does it make sense for smaller businesses?

I have considered it for my company because it can do some neat things, but I
feel a bit overwhelmed by it. Really curious about the feedback.

~~~
adavis321
I work for the federal government. Another team in my organization is using it
for contact management and some other CRM tasks. They are very happy with it.
My team is developing a custom dashboard prototype for leadership. Our results
are mixed. Please note that I've only been working on this project part time
for about 4.5 months, so I'm far from an expert.

Basic entry and view forms are very easy to create; Basic reporting is very
easy, as well as basic charting. But the provided charting components can only
be customized up to a point. For example, you can set the color of chart
segments by value for pick-list fields, but not for calculated fields, and
only for certain types of charts.

Salesforce is a big, complicated system and it takes a while to learn. If your
needs can be met by their built-in Sales or Service modules then it may be a
great choice. If your needs can be met by a 3rd-party add-on, and you're
willing to pay extra for that, it may also be a good choice. If you want to
recreate your custom business logic in Salesforce then you may want to hire a
consultant.

Salesforce also has a lot of pricing and licensing options, so you would need
to be careful about making a purchase before you know all of your needs and
understand the different license types and pricing tiers.

~~~
cosmodisk
Salesforce reporting is relatively basic,consider Einstein Analytics for more
advanced stuff. Alternatively,just connect it to Tableau and do all the fancy
shpancy stuff there.

------
mrdoops
Using the Lightning Web Components without the Salesforce back-end is a
compelling idea. The design system is well tuned for standard business
requirements (rich data-tables, modals, forms, etc.). If there's a good story
around using those UI components without having to use the Salesforce back-end
this could have value. The Salesforce back-end is a scary entity-attribute-
value system coupled to an Oracle database on top of a layer-cake of legacy
multi-tenant architecture constraints and years of Java/C code.

~~~
davidbanham
I've done this with the older lightning CSS based toolkit and it was great.

The front end was React/Redux and we just wrapped the bits of markup we needed
into React components.

------
tvphan
How long has this been around? I had to recently build a React app for
Salesforce and I had to set it up as something called a Lightning Container
Component, which was pretty much a glorified iframe.

~~~
vips7L
I think LWC has been GA for ~6 months. It is leagues better than the old Aura
components.

------
drcongo
I may be entirely misunderstanding what the point of this is, but wouldn't it
be better if they just made their API unhorrible and let people use their own
components?

------
chenster
[https://vaadin.com/](https://vaadin.com/) has been doing web components for a
while now in open source.

~~~
pjmlp
Yeah, that is where they went after Google lost interest in GWT.

~~~
chenster
What do you mean that's where they went? Is it a spin off from the G?

~~~
pjmlp
Vaadin started as a set of GWT component library, Eclipse extensions and GUI
editor.

------
getpolarized
I don't understand the goal of this. Is it to replace React/Angular or are
these components like tree controls, tab controls, etc?

~~~
megaman821
It looks like it is a set of components and helpers for building components of
your own.

The good thing about Web Components is that they are reusable across
frameworks. You don't need jQuery-picker, react-datepicker, and vue-datepicker
just <my-datepicker /> and its reusable anywhere.

------
jefflombardjr
Salesforce is brilliant at marketing, I would take this PR announcement with a
grain of salt.

Lightning was already based on open source software - their Aura Framework. As
of March 2019 they decided that they were going to continue to maintain it,
but were ceasing to make it open source.

You can read the notice here:
[https://github.com/forcedotcom/aura](https://github.com/forcedotcom/aura)

------
datpuz
Just poking fun, but I like how the post says "Many features that required
frameworks are now standard" then introduces a... new framework!

------
erikrothoff
Looks a lot like Ember and their Glimmer.js components system.

~~~
elfogris
Certainly Yehuda from Ember had some influence on us :), so as many others
like Richard from Svelte or Evan from VueJs.

A lot of good conversations happen within the last two years to be where we
are today!

Hopefully some of our solutions and ideas will help improve the ecosystem.

------
EGreg
What is the point of this? Where are the examples?

~~~
sdegutis
Their home page says:

> Lightning web components are custom elements built using HTML and modern
> JavaScript.

> The Lightning Web Components UI framework uses core Web Components standards
> and provides only what’s necessary to perform well in browsers. Because it’s
> built on code that runs natively in browsers, the framework is lightweight
> and delivers exceptional performance. Most of the code you write is standard
> JavaScript and HTML.

> Build apps anywhere, any way. You can build an app with your favorite tools,
> like Webpack, TypeScript, and Babel, and run it on Heroku, Google, or
> anywhere else. You can also package an app to create a desktop experience in
> Electron.

Which I _think_ is equivalent to just saying this:

> Lightning Web Components is a lightweight, cross platform, and framework-
> independent web components library that builds on the native Web Components
> standards to add some convenient functionality.

~~~
elfogris
Beautiful as well :)

------
TotempaaltJ
Can we change the title to something like "Salesforce open sources Lightning
Web Components framework"?

~~~
sctb
Updated from “Lightning Web Components Open Source”. Thanks!

------
etchalon
I have a hard time getting excited about a framework whose announcement post
fails to do something as basic as ensure their images resize on mobile.

~~~
pcurve
I couldn't believe my eyes but you are right.

~~~
elfogris
We will work with marketing to fix it. Hopefully
[http://lwc.dev](http://lwc.dev) works better, but any feedback is welcome :)

~~~
lucasverra
Now there are way to small on desktops :(
[https://drive.google.com/file/d/1V9qB8V9RcTQ9h-Og4YAIao8FOFe...](https://drive.google.com/file/d/1V9qB8V9RcTQ9h-Og4YAIao8FOFeGtN5I/view?usp=drivesdk)

~~~
dmix
Marketing needs to have a web developer on the team. Can't leave this stuff to
the sales guys.

