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

POC / Support old browsers by using @vitejs/plugin-legacy #179

Closed
wants to merge 1 commit into from

Conversation

langemike
Copy link

@langemike langemike commented Apr 16, 2024

This change will make the site work on older browsers.

Build instructions:

cd platforms/web
APP_DEFAULT_CONFIG_SOURCE=gnnuzabk LEGACY_DEBUG=true  yarn build
yarn vite preview --host

Now visit the URL in your old browser.

Unfortunately, you will need to rebuild the app on every change since it is not possible to inject polyfills/transforms on-the-fly on a dev server.

I ran into an issue where Chromium 68 should load the "legacy" version based on a browser feature detection algorithm within plugin-legacy (see source). But it didn't.

Therefore I introduced the LEGACY_DEBUG flag to enforce loading the polyfills. I can give a detailed explanation about this endeavor if needed (it goes in to the specifics of chromium) ;) This is what I finally ended up with. I think this makes development easier, as we can locally install Chromium instead of being dependent of an external browser.

LEGACY_DEBUG is a temporary solution that I do not want to commit into the code.

I still need to find some kind of way to combine @vitejs/plugin-legacy with vite-plugin-html because currently I discarded the latter, because the first takes care of the logic of deciding in loading the modern vs. legacy bundle.

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

@langemike
Copy link
Author

You may have a look at the basis of supporting old browsers. Tomorrow after the daily I can tell you how I would like to move forward @ChristiaanScheermeijer @MelissaDTH @royschut

Feedback is already welcome.

@langemike
Copy link
Author

Transformed POC in to a proposal: #182

@langemike langemike closed this Apr 17, 2024
@royschut royschut deleted the feat/poc-vite-legacy branch April 17, 2024 14:28
@langemike langemike restored the feat/poc-vite-legacy branch May 30, 2024 12:35
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.

1 participant