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

Update browserify list in transpile #1323

Closed
zepumph opened this issue Sep 7, 2022 · 35 comments
Closed

Update browserify list in transpile #1323

zepumph opened this issue Sep 7, 2022 · 35 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Sep 7, 2022

Currently we have:

https://browsersl.ist/#q=%3E+0.5%25%2C+safari+10-11%2C+Firefox+ESR%2C+not+IE+11%2C+ios_saf+11

">0.5%, safari 10-11, Firefox ESR, not IE 11, ios_saf 11"

I recommend:

https://browsersl.ist/#q=%3E+0.25%25%2C+not+dead

">0.25%, not dead"

It increases our coverage from 89% to 92.5% and removes some very outdated, hard coded browser versions.

We don't have to change our IE11 logic, we can still have

> 0.25%, not dead, not IE 11 or > 0.25%, not dead, IE 11 depending.

@jonathanolson, can you think of any reason to keep the current browsers. For example we are hard coding safari 10 and 11, why? I'm happy to implement.

@zepumph
Copy link
Member Author

zepumph commented Sep 7, 2022

Discovered while debugging phetsims/ratio-and-proportion#508 with @samreid.

@jonathanolson
Copy link
Contributor

@jonathanolson, can you think of any reason to keep the current browsers. For example we are hard coding safari 10 and 11, why? I'm happy to implement.

I'm fine if this changes to something closer to our supported platforms. No particular relevant-for-now reason we have those hard-coded.

@zepumph
Copy link
Member Author

zepumph commented Sep 13, 2022

Great, thanks!

@zepumph zepumph closed this as completed Sep 13, 2022
@samreid samreid reopened this Oct 28, 2022
@samreid
Copy link
Member

samreid commented Oct 28, 2022

This commit increases the heap size of Geometric Optic Basics Built PhET brand from 38.1MB to 58.7MB. Startup time feels a little slower too.

@pixelzoom edit: ... as reported in phetsims/scenery-phet#769 (comment)

@samreid
Copy link
Member

samreid commented Oct 28, 2022

> 0.43%, last 2 versions, Firefox ESR, not dead report 90% and still gives us the smaller size

@samreid
Copy link
Member

samreid commented Oct 28, 2022

According to https://browsersl.ist/

Use defaults if you're building a web application for the global audience.

You can pick a sound set of versions with the defaults query which is a shortcut for > 0.5%, last 2 versions, Firefox ESR, not dead. It matches recent versions of popular and supported browsers worldwide and includes Firefox Extended Support Release which is updated roughly annually.

The defaults query was thoroughly designed by the Browserslist community. It helps promote best practices and avoid common pitfalls.

So maybe defaults sounds good?

@zepumph
Copy link
Member Author

zepumph commented Oct 28, 2022

Seems reasonable to me!

@samreid
Copy link
Member

samreid commented Oct 28, 2022

OK pushed. Confirmed the build size is lower. @zepumph or @jonathanolson can you please spot check?

By the way, here is my search that led here:

10/28/22: 58.8M
4/1/22 42.4M
5/1/22 42.5M
6/1/22 46.3M
7/1/22 46.7M
8/1/22 50.3M
9/1/22 52.4M
10/1/22 82.5M
9/15/22 82.5M
9/7/22  BROKEN
9/6/22  48.8M
9/12/22  49.3M
9/14/22  84.3M

@jonathanolson
Copy link
Contributor

Looks good to me, can we confirm that this is working on all of our supported platforms?

@jonathanolson jonathanolson removed their assignment Oct 28, 2022
@samreid
Copy link
Member

samreid commented Oct 29, 2022

Perhaps an upcoming RC test will help us verify this is OK. @KatieWoe can you please be aware of this issue for the next round of QA testing (that has a fresh RC)?

@KatieWoe
Copy link

Ok. Can you give some details on what we should look for?

@samreid samreid assigned oliver-phet and kathy-phet and unassigned samreid Nov 1, 2022
@kathy-phet
Copy link

Let's go with this to unblock for now ..
const browsers = [
'defaults',
'safari >= 13',
'iOS >= 13'
];

This matches what we say on the website.

@kathy-phet
Copy link

@samreid - You can make an issue to consider supported browsers, and potentially update to supported systems. This requires making a change in our website language to match what "defaults" has. And should be communicated to our client partners as well.

@kathy-phet
Copy link

@pixelzoom - With this change, (marla committed above), does it make sense to rebuild the dev tests for GOB?

@oliver-phet
Copy link

@oliver-phet - Can you add in the use we see at the PhET website for the iOS and Safari versions of browsers?

Last 30 days (3,872,563 Safari users):
*Total does not = 100% because of strange browser versions (i.e. "Safari 13609.3.5.1.5")

Safari 7+ 320 0.008%
Safari 8+ 80 0.002%
Safari 9+ 900 0.023%
Safari 10+ 2357 0.061%
Safari 11+ 3028 0.079%
Safari 12+ 57981 1.504%
Safari 13+ 52747 1.368%
Safari 14+ 316834 8.218%
Safari 15+ 2613689 67.795%
Safari 16+ 683626 17.732%

Total ~95% of users on Safari 13+
Total ~1.6% of users on <Safari 13.

@kathy-phet
Copy link

Thanks, Oliver. @samreid - defaults don't include all versions of Safari 14 , so we should not be using just defaults imo.

@marlitas - Your commit looks like it updated with the safari and iOS needs.

Any reason I cannot close this issue?

@pixelzoom
Copy link
Contributor

pixelzoom commented Nov 1, 2022

@pixelzoom - With this change, (marla committed above), does it make sense to rebuild the dev tests for GOB?

@kathy-phet your call. If you'd like to cancel the current dev test, please note in phetsims/qa#847.

That dev version (1.2.0-dev.3) was built when transpiler.ts was configured for "default". Because it's a dev version, there's no release branch to patch, and we'll pick up the transpiler.ts on the next dev version, or when we create the first RC.

@kathy-phet
Copy link

@pixelzoom - Looks like we don't test those browsers in a dev test anyways, so no need to redo the dev.

I'm going to close this issue. @samreid @marlitas - reopen if you see a reason.

@pixelzoom
Copy link
Contributor

pixelzoom commented Nov 10, 2022

Reopening. We had a design meeting on 11/10/2022 where some important decisions were made.

  • macOS 10.13 will be dropped from System Requirements. @KatieWoe will make an issue to update the PhET website.
  • We'll leave transpile.js the way it currently is.
  • We will sometimes has older platforms in transpile.js that are not advertised in System Requirements on the PhET website.
  • We should never remove platforms that are advertised in the System Requirements on the PhET website without a broader discussion.
  • I will document these decisions in transpile.js, at the appropriate place.

@pixelzoom pixelzoom reopened this Nov 10, 2022
pixelzoom added a commit that referenced this issue Nov 11, 2022
@pixelzoom
Copy link
Contributor

I documented the browsers list in transpile.js, see below. Closing.

  // This list specifies the target browsers for Babel. Its format is described at https://browsersl.ist.
  // Note that this is related to System Requirements advertised on the PhET website, so should be modified with care.
  // Never remove advertised platforms from this list without a broader discussion. And note that PhET will sometimes
  // provide unofficial support for older platforms, so version numbers may be lower than what is advertised on the
  // PhET website. For more history, see https://github.com/phetsims/chipper/issues/1323.
  const browsers = [

@kathy-phet
Copy link

@pixelzoom - I didn't think this was for Babel? I thought browserify was broader - back converting code to support use of newer js patterns.

@kathy-phet kathy-phet reopened this Nov 11, 2022
@pixelzoom
Copy link
Contributor

pixelzoom commented Nov 11, 2022

The format for the browsers list is indeed broader. See the link I provided in the comment (https://babeljs.io) which states:

Shared browser compatibility config for popular JavaScript tools like Autoprefixer, Babel, ESLint, PostCSS, and Webpack

transpiler.js is more specific. It passes the browsers list to babel. Line 39:

 return babel.transform( jsInput, {
...
      targets: {
        browsers: browsers
      }

@pixelzoom
Copy link
Contributor

pixelzoom commented Nov 11, 2022

Also note the overview documentation of transpiler.js at line 4:

  * Handles transpilation of code using Babel

So I'm going to close this. Reopen if you have more questions.

@samreid
Copy link
Member

samreid commented Nov 11, 2022

Babel is a 3rd party open source library which transpiles code versions, not to be confused with phetsims/babel which contains our sim translations.

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

8 participants