-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Flow with TypeScript to avoid Facebook’s BSD Patents License #6411
Comments
Flow is used only as a dev dependency, and flow syntax is stripped in the built files, so for end users of Vue (e.g. consuming from NPM) there is nothing related to Flow in the distributed code, which doesn't make them affected by Flow's license in any way. The only concerning case would probably be someone forking Vue and thus using the source code directly - but even so, flow's own code (governed by its license/patent grant) is not distributed in any way either. I doubt that the mere usage of Flow's syntax is subject to its license. I think this is a valid concern, but at this moment the logistic costs of migrating can be blocking factor. Maybe someone on the team who are familiar with both Flow/TS can evaluate how much effort that entails. |
That makes sense. What's interesting is that jsx is under Creative Commons Attribution 4.0 International License while Flow isn't really clear. If Vue.js does end up migrating to TypeScript I can also help with that effort. |
Considering the fact that typescript team members are interested in Vue (#5887) I would vote for migrating to TypeScript. However, I use flow on day-to-day basics and there is one great feature that I miss in TypeScript (probably more if I do some research). In flow you can use Return type of a function, in TS you cannot. |
HI @gdi2290 , I think @yyx990803 has clear reasoning here. Let me explain some technical issue here. Migrating to TypeScript is doable, but requires many changes at once. We cannot use TS and Flow still have many subtle syntax differences. These differences are small, but ubiquitous. e.g. https://github.com/vuejs/vue/blob/dev/flow/compiler.js#L4 Other potential issues might be TS/Flow's checking rules. e.g. Flow allows |
I created an issue in Flow and they say it's under Facebook’s BSD+Patents License most of the syntax for TypeScript and Flow are similar and in some cases TypeScript allows you to be more strict. If the TypeScript is interested in vue then perhaps vue can request some features in Flow that @nickmessing mentioned |
@gdi2290, All features I could find are already requested in the issues but looks like TypeScript team is really busy and they need to clear that 2.5k issues backlog :) |
Forgive the random outside opinion, but would this really be worth it? Seems like the only benefit would be a potential licensing "problem" that doesn't really affect anything outside of Vue itself... |
@kirbyfan64, as @HerringtonDarkholme said, it's obviously too much human effort and need to be done during a big code freeze and most probably we don't have that much human effort available, but this is still open for discussion. |
Actually whole Line 10 in 82f03de
However, not sure if this could be treated as something Flow-related for the end user. |
I would be suprised to find that Facebook has any patent on their type annotation syntax, considering that this has been done before. And since you are not actively using neither Flow nor the vue source files, you are not using anything flow-related anyway. |
@LinusBorg Flow's license is BSD with Patents, same as React:
Which in my opinion, means that any proprietary product you develop, Facebook can come in and develop the same thing without any fear of lawsuit. Because if you do file suit and you are using Flow (or React or any other BSD+Patent licensed Facebook software on GitHub) your license to use the software terminates, invalidating any proprietary claims you may have had. TL;DR; yes, I think using the Flow syntax alone does impact Vue.js from a legal standpoint, but I'm not a lawyer, this is just my opinion. |
But you are not using Flow, are you? Nothing in Vue's code that you use contains any hint of Flow. The fact that we (the Vue maintainers) used Flow in our build process to create these files, all while we had/have a licence to Flow, is of no concern to you. You are not using Flow or any of it's patented technologies (if there are any, no one could find applications so far). Every other interpretation would be crazy, because it would mean that people who do not use the patented technology could get legal problems because of a product they use that was once build with those patents while it was legal. That's crazy. If that's true you should stop writing software alltogether because you can be sued for anything and everything any second. That would mean that if someone held a patent to something used in webpack, you would have to stop using your already built files because they were once built with webpack while it was still legal. |
@LinusBorg, you may be right, like I said I'm not a lawyer or an expert in law. I just think their licensing goes against the general nature of open source, it's dumb that these types of threads and considerations even need to exist. |
I will say if we do decide to convert over I would be happy to help have had a lot of success/practice lately converting projects over and I am helping as much as I can on the eslint TypeScript compatibility work. I would be for this for a lot of reasons including the patent issues but understand if the majority/core team is not. |
How about Vue 3.0 with codebase rewriting in TS and has full TS support like Angular? |
I'm down for Vue 3.0 being TypeScript then we can take learnings from Polymer 3 |
I would be interested in helping convert to typescript as well if needed. |
doesn't it causes longer learning curve + more Angular-like nature? starting with longer time waiting for the first update(Vue3). due to all Vue team learning, and experimenting this new technology. yes the coming ones may become faster. because it makes TS must learnt technology before diving to Vue.js + it loses Vue one of it's greatest points over Angular and React (the shorter learning time), so I am against the idea of migrating TS |
@khaled-nuur typescript would only be used for vue's source code similar to Flow which doesn't mean you need to use it. You still need to learn about types with Flow just as you would with TypeScript the difference is that one has more support and a bigger community |
@khaled-nuur Also my understanding is that Angular really tries to enforce full typing when you use TypeScript which to me is pretty silly as I feel like its ability to choose when and where to type is one of its strengths. For example I don't tend to type my application code much but when I break something into a module or component I type it just as I document it. That way 5 months from now when I make an application change I don't need to go reread that component. If that makes any sense. My understanding is Angular kinda more forces you into all or nothing |
Here's an article about how "JavaScript libraries should be written in TypeScript". Just because the codebase is TypeScript doesn't mean the application developer needs to use TypeScript. Angular is more or less targeting enterprise developers which largely benefit from a TypeScript codebase. They also doubled down on decorators which looks better in TypeScript compared to ES6 so their code examples would always look better in TypeScript. They also support ES6 and ES5 but don't really advertise it much // Angular es5 syntax
(function (app) {
const AppComponent = ng.core
.Component({
selector: "my-app",
template: "<h1>My First Angular 2 App</h1>"
})
.Class({
constructor: function constructor() {}
});
app.AppModule = ng.core.NgModule({
imports: [ng.platformBrowser.BrowserModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
}).Class({
constructor: function constructor() {}
});
}(window.app || (window.app = {}))); vs typescript @Component({
selector: "my-app",
template: "<h1>My First Angular 2 App</h1>"
})
class AppComponent {
}
@NgModule({
imports: [BrowserModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
class AppModule {} Vue's codebase doesn't really mention that it's using a typed language so all of problems people are mentioning for TypeScript in this repo are already there with Flow. Even if Vue uses TypeScript they don't need to use decorators. If Vue did the API would look the same for example https://github.com/kaorun343/vue-property-decorator |
we're going to be relicensing Flow under MIT: https://code.facebook.com/posts/300798627056246 hope this relieves the concerns here! |
@mroch wow, big news! I guess this can be closed for now then ;) |
What problem does this feature solve?
Flow in under Facebook’s BSD Patents License and this project was built with it
What does the proposed API look like?
TypeScript which has the Apache License 2.0
The text was updated successfully, but these errors were encountered: