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

Don't transpile to ES5 #772

Merged
merged 4 commits into from
Nov 14, 2024
Merged

Conversation

vincentfretin
Copy link
Contributor

We used @babel/preset-env without browserlist config in package.json, so @babel/preset-env defaulted to ES5 and not browserlist defaults query that applies modern browsers. See doc
https://babeljs.io/docs/babel-preset-env
https://babeljs.io/docs/options#no-targets
but really nowadays we don't need to transpile to ES5, that was at a time we needed to support IE11.
We don't use any fancy javascript syntax here, only ES6/ES2015 that is supported by all supported browsers.

Bundle size reduced from 521K to 426K. Transpiling to ES5 included lots of polyfills we don't need.

@vincentfretin
Copy link
Contributor Author

I just had the idea to do this PR while watching https://www.youtube.com/watch?v=odhjF1obcUo

@vincentfretin
Copy link
Contributor Author

To use it:

<a-scene inspector="url: https://cdn.jsdelivr.net/gh/aframevr/aframe-inspector@ddda46f4376cf696e623721d98e1c2eb3e799b73/dist/aframe-inspector.min.js">

@vincentfretin
Copy link
Contributor Author

We could also just remove the single test https://github.com/aframevr/aframe-inspector/blob/master/src/components/__tests__/Collapsible.test.js and jest, babel-jest, react-test-renderer dependencies instead of reintroducing @babel/preset-env in f8f9035
@dmarcos thoughts?

@dmarcos
Copy link
Member

dmarcos commented Nov 14, 2024

Yeah we don't need to transpile to ES5 I think. Is this ready to merge?

@vincentfretin
Copy link
Contributor Author

You can merge as is yes.

@dmarcos
Copy link
Member

dmarcos commented Nov 14, 2024

Thanks so much!

@dmarcos dmarcos merged commit ec38559 into aframevr:master Nov 14, 2024
1 check passed
@vincentfretin vincentfretin deleted the dont-transpile-to-es5 branch November 14, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants