Skip to content
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

ES5 support seems to be dropped? #243

Open
erangakm opened this issue Apr 27, 2021 · 6 comments
Open

ES5 support seems to be dropped? #243

erangakm opened this issue Apr 27, 2021 · 6 comments

Comments

@erangakm
Copy link

Hi,

I've got a project that's strict checking es5 support (with https://www.npmjs.com/package/es-check) and recently it's been tripping up on runtypes' unicode regex.

I still see that the project's tsconfig.json has es5 for target and I'm just wondering if this was intentional.

Cheers.

@yuhr
Copy link
Collaborator

yuhr commented Apr 27, 2021

Hm, I was just unsure if we should still stick to ES5. If so, it feels like we need to integrate Babel transpilation into our build process, because it's hard for us to maintain legacy-compliant code on our own. @pelotom, how should we do?

IMAO most people are using Babel universally for actual applications. This is purely a question, wouldn't it be an option to use Babel for your project? Then what reasons?

@mscharley
Copy link

I work with @erangakm . Yes, it'd be an option and that was going to be our fallback, but we aren't already using Babel as the application itself is using TypeScript so we already have an new ES -> old ES transpilation for our own code in that. We'd only need Babel for supporting libraries using newer features and runtypes was the first one we use that have caused issues there.

@yuhr
Copy link
Collaborator

yuhr commented Apr 30, 2021

I see. Personally I don't really have much opposition to maintain ES5 support with Babel in this package's side, but I'm afraid of introducing some performance drop and/or being hit by inconsistent behaviour to the web standard (especially when working with Symbols) by doing that, though maybe these are small things to worry about.

So... at this point I'd just recommend using Babel in applications' side. But I still want to seek some advices for this.

@mscharley
Copy link

Yeah, similarly we don't have any real strong opinions either way. We can setup babel if we need to, we just weren't sure what the intention was here as the build system for the library seemed to be targeting ES5 but the code wasn't actually compatible so we wanted to raise it upstream to see what the current stance actually is.

@rraval
Copy link

rraval commented Apr 30, 2021

Hi, just adding another data point.

We have a real application that wants to use runtypes but we don't use babel (our first party code uses Typescript itself to target ES5). It would be nice if this library were ES5 compliant for IE11 support, but we can look at integrating babel into our build pipeline as well.

@yuhr
Copy link
Collaborator

yuhr commented May 2, 2021

Just investigating how we could achieve optimal results, I found https://github.com/developit/microbundle is a good way to go. Integrating a bundler will also result in single file build (for each target), that resolves #175, #155, and #145 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants