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

Feat / Manage minimum browser support #186

Closed
wants to merge 7 commits into from

Conversation

langemike
Copy link

@langemike langemike commented Apr 23, 2024

We want to specifically support browsers from chrome68 and up.
Vite internally uses ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']. So the difference is quite small.

See: https://vitejs.dev/guide/build#browser-compatibility

I only needed to write a CSS fallback for the dvh unit because it was the only unsupported CSS feature we have ran into.

I have written a detailed explanation why we do not want to use @vitejs/plugin-legacy in this current stage.

I've tested this on Chrome 68 using browserstack.

Ticket: https://videodock.atlassian.net/browse/OTT-1335

@langemike langemike temporarily deployed to Deployment Previews April 23, 2024 13:50 — with GitHub Actions Inactive
@langemike langemike changed the title feat(project): manage minimum browser support Feat / Manage minimum browser support Apr 23, 2024
@@ -114,6 +114,7 @@ export default ({ mode, command }: ConfigEnv): UserConfigExport => {
cssCodeSplit: false,
sourcemap: true,
minify: true,
target: ['es2020', 'edge88', 'firefox78', 'chrome68', 'safari14'],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to differentiate between minimum browser support (e.g. a private repo), I suggest using this package: https://github.com/marcofugaro/browserslist-to-esbuild. Where we can load a different .browserslistrc

In the current approach i kept it simple.

Copy link

@royschut royschut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

platforms/web/package.json Show resolved Hide resolved
@@ -8,6 +8,7 @@
left: 0;
z-index: variables.$modals-z-index;
width: 100vw;
height: 100vh; // Fallback
Copy link

@MelissaDTH MelissaDTH Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should elaborate a little bit on what this serves as a fallback for (and the other // Fallback code comments)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Christiaan and I talked about it and reasoned to keep it short. If you (and others) don't mind, I will submit this to the OTT repo. Because it is immediately placed before the (original) value, I hope the intention of the comment is clear enough.

I'll change it of course if somebody else does think it is necessary.

Copy link

@MelissaDTH MelissaDTH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, but other than that you have my approval!

@@ -130,6 +131,9 @@ export default ({ mode, command }: ConfigEnv): UserConfigExport => {
if (id.includes('/node_modules/@inplayer')) {
return 'inplayer';
}
if (id.includes('/node_modules/core-js')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, perfect! Can/do we need to ensure that this file is loaded before others?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed this FAQ guide https://rollupjs.org/faqs/#why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting and put the polyfills imports on top, based on my recent change. This should ensure they are loaded first.

I thought about bundling the imports in a src/polyfills.tsx file and importing this on top, but I leave that idea open for you or others to decide.

@langemike langemike temporarily deployed to Deployment Previews April 25, 2024 13:24 — with GitHub Actions Inactive
@langemike langemike added the pr-submitted The PR has been submitted to the OTT Web App repo label Apr 25, 2024
@langemike langemike temporarily deployed to Deployment Previews April 29, 2024 08:43 — with GitHub Actions Inactive
@langemike langemike temporarily deployed to Deployment Previews April 29, 2024 09:21 — with GitHub Actions Inactive
@langemike langemike temporarily deployed to Deployment Previews May 1, 2024 09:49 — with GitHub Actions Inactive
@langemike langemike force-pushed the feat/vite-minimum-browser-support branch from 9555b4e to dc1022c Compare May 29, 2024 15:25
@langemike langemike temporarily deployed to Deployment Previews May 29, 2024 15:25 — with GitHub Actions Inactive
@langemike langemike force-pushed the feat/vite-minimum-browser-support branch from dc1022c to bc6b79a Compare May 29, 2024 15:53
@langemike langemike temporarily deployed to Deployment Previews May 29, 2024 15:53 — with GitHub Actions Inactive
@langemike langemike force-pushed the feat/vite-minimum-browser-support branch from bc6b79a to 0e7bb82 Compare June 3, 2024 12:14
@langemike langemike temporarily deployed to Deployment Previews June 3, 2024 12:14 — with GitHub Actions Inactive
@langemike langemike temporarily deployed to Deployment Previews June 4, 2024 08:05 — with GitHub Actions Inactive
@langemike langemike closed this Jun 4, 2024
@royschut royschut deleted the feat/vite-minimum-browser-support branch June 5, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-submitted The PR has been submitted to the OTT Web App repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants