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

Making pack:web work by adding polyfill #2678

Conversation

MarmadileManteater
Copy link
Contributor

Making pack:web work by adding polyfill

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Description

This PR makes the pack:web script work by adding the polyfill from browserify to webpack. This should effectively be the same thing as running browserify on the result of webpack; except that, it is way faster to build, and it won't bugger up the nice clean directory structure that webpack puts in Inspect Element in development builds. These things alone make this web build infinitely easier to debug and run than my existing web build.

Screenshots

Before:
image
After:
image
image
image

image

Testing

yarn pack:web will create all of the files needed for the web build, but since this web app needs to be hosted on a server and cannot be served directly off the filesystem, you will probably want to break out your favorite one liner like http-server and navigate to http://127.0.0.1:8080/dist/web/index.html.

Desktop (please complete the following information):

  • OS: Windows 10
  • OS Version: Pro Version 21H2 Installed on ‎4/‎3/‎2022 OS build 19044.1889 Experience Windows Feature Experience Pack 120.2212.4180.0
  • FreeTube version: 0.17.1

Additional context

It may be worth noting, but there is code currently in the codebase which assumes that the application is in Electron if the environment is development. That code may have to be changed in the future if it would make sense to run the web build in development mode.

One major caveat of this solution is that it depends on bringing in two new packages browserify@^17.0.0 and process@^0.11.10. I don't see a way to achieve this without bringing in at least one new package or manually writing all of our own polyfill. Both of those solutions have their advantages and disadvantages.

@PrestonN PrestonN enabled auto-merge (squash) October 5, 2022 02:36
@github-actions github-actions bot added PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Oct 5, 2022
@ChunkyProgrammer
Copy link
Member

I think you still need to run yarn install to update the lock file

auto-merge was automatically disabled October 5, 2022 10:52

Head branch was pushed to by a user without write access

@PrestonN PrestonN enabled auto-merge (squash) October 5, 2022 10:52
auto-merge was automatically disabled October 5, 2022 10:58

Head branch was pushed to by a user without write access

@PrestonN PrestonN enabled auto-merge (squash) October 5, 2022 10:58
`buffer` doesn't have to be included through browserify
auto-merge was automatically disabled October 5, 2022 11:05

Head branch was pushed to by a user without write access

@PrestonN PrestonN enabled auto-merge (squash) October 5, 2022 11:05
PikachuEXE
PikachuEXE previously approved these changes Oct 6, 2022
absidue
absidue previously approved these changes Oct 6, 2022
@github-actions github-actions bot added PR: merge conflicts / rebase needed and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Oct 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

This pull request has conflicts, please resolve those before we can evaluate the pull request.

auto-merge was automatically disabled October 6, 2022 14:38

Head branch was pushed to by a user without write access

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

Conflicts have been resolved. A maintainer will review the pull request shortly.

@PrestonN PrestonN enabled auto-merge (squash) October 6, 2022 14:39
@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added the PR: waiting for review For PRs that are complete, tested, and ready for review label Oct 6, 2022
@PrestonN PrestonN merged commit 2e84b44 into FreeTubeApp:development Oct 6, 2022
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Oct 6, 2022
@MarmadileManteater MarmadileManteater deleted the adding-polyfills-to-pack-web branch March 16, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants