-
Notifications
You must be signed in to change notification settings - Fork 77
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
Change how the compat builds are produced #269
Comments
@Pike, @zbraniecki - go / no go? |
What I'd like us to have is some testing infrastructure that tells us if we're going to run into trouble while we're working on PRs. Asking a couple of stupid questions, because I know Jack about how JS works. Is the ES5-compatible transpilation going to tell us that? Can we run tests against it? Track its size? Also, do those entry points publish code we generate, or are they instructing other folks on how to generate it, and could they fail because of their own setup? |
Yes. I've used
We could have a test which tries to run the ES5-compatible version and makes sure all known required polyfills are accounted for. Does this answer your question?
I think we should publish all of them. Cosumers of the library will be then able to choose any of:
|
Would it help to run a couple of integration tests on each bundle in a couple of node versions? (couple in the sense of English "2 or so") |
I'd like to challenge that a bit :)
That's not exactly how we should phrase this conversation imho. Fluent is a modern JS project. It requires "es6" (or whatever name you want to use - ES2018?). We can try to keep supporting ES5, but IMHO we should accept that we are an ES6 project. It's not unreasonable and we are not the only ones. Increasing number of projects expect modern JS environments and this trend will just continue. Being a small pre-1.0 project means that we either embrace it, or spend resources trying to maintain the backward compatibility with increasing number of issues (Will we reject a build system tool that works for us, but is not compatible with es5? Will we reject an improvement to the system which does work with es5?). I suggest we aim for two builds:
|
I'd like to challenge that a bit :) We have existing projects at mozilla that use Fluent to localize their work. We can't just throw them under the bus. |
I'm with Axel on this one. We benefit a lot from the fact that Fluent is already used in projects like Test Pilot and Common Voice. We get real-life validation which would be hard to get otherwise. I understand your position, @zbraniecki, and I think The vanilla & matrix approach is what we do right now, but it's not working for projects like Test Pilot. I agree that we should explicitly document that the ES5-transpiled builds are only intended for existing projects which already use Fluent. Any new projects should at least the matrix-compatible builds, or in case of Gecko, the vanilla ones. |
That's cool. They signed up for a ride with a work-in-progress pre-1.0 project in a dynamic environment that gets modernized. The division line between "We haven't updated project X to modern toolchain" and "We don't really maintain this project anymore" is very thin. I'd like to make sure whatever we decide here, we don't add work because of projects that are on es5 because they're staled. In my experience most projects will continually upgrade their toolchains if they're active, and we should focus on those.
Did we talk to Test Pilot about it? Are we the only thing that pushes them to embrace es6 in their build system? Are there other reasons? Are they planning to, or will they stay on es5 forever? |
"We" filed mozilla/testpilot#3789 to start this conversation. I honestly think it's less work, objectively, for us to introduce an ES5-compatible build target than for any of the projects using Fluent to upgrade their entire toolchain. |
If the equation is just that. But it may be a false dichotomy which is what I asked about. If Test Pilot is under pressure to update their toolchain from multiple sources, then maybe we're just part of the wave. If we're the only ones that would pressure them, and they're an active project interested in updating Fluent but at the same time committed to sticking to es5 level toolchain, then I agree. |
@Pike It all boils down to which polyfills are available. We currently require the polyfills before tests even run, which is a very effective way of hiding any potential failures. OTOH, the transpiled builds are not supposed to work without polyfills. Do you have a suggestion for how the integration tests you mention would look like? |
AFAICT, the tests all import from |
I meant this: https://github.com/projectfluent/fluent.js/blob/master/mocha_setup.js. Or this: https://github.com/projectfluent/fluent.js/blob/master/fluent/test/index.js#L4. I'm not sure testing infra can solve this. It won't save us from another bug in UglifyJS. As for different node versions, perhaps we should focus on documenting which versions of node require which polyfills. |
I'd like us to improve the effectiveness of our tests, but I don't want to block this issue on it. I'm going to start on the implementation tomorrow. |
Note to self: the ES5-compatible builds will suffer from the Most consumers rarely need both sync and async versions of |
Actually, maybe not. I'm experimenting with ES5-compatible builds and as long as I've now narrowed down the issue to |
I feel like I'm slowly piecing together the full picture. Fluent's
Uglify packages are rarely used by themselves. Instead they are often part of some other build tool, like Webpack or Gulp. And while I found |
I'm going to put this issue temporarily on hold. We can't reliably test upgrading to DetailsBecause of the
Unfortunately upgrading to |
It turned out that changing the As of today, all Mozilla web project using Future upgrades of Fluent packages used in web projects will be much easier now because their build systems are now compatible with modern ES and we've verified this with the upgrade to |
#133 changed the browser compatibility matrix of our
compat
builds. It was a good decision for Fluent and for the web. Unfortunately, while most browser support modern JavaScript, it turns out a significant portion of build tools like Webpack and more specifically, UglifyJS, do not 🤦♂️ .I'm afraid we might need to re-implement strict ES5 compatibility in one way or another. I don't think we can expect existing projects to go through the whole ordeal of updating their build pipeline just to be able to use a newer version of
fluent
and friends.Right now we produce two builds for each package:
index
- no transpilation at all, andcompat
- transpiled according to the modern compatibility matrix.The moder compatiblity matrix expects the engine to support async functions, classes and generators, among others.
I propose we switch to the following strategy:
index
- transpiled according to the modern compatibility matrix,compat
- transpiled to strictly ES5-compatible code,vanilla
- not transpiled at all. This could also be calledmodern
orecma
.The
vanilla
builds will be allowed to use cutting-edge features like async iteration, implemented only in Firefox 57 and Chrome 63.The text was updated successfully, but these errors were encountered: