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

Add write-to-disk watch mode for kolibri tools to allow single origin dev testing. #4826

Closed
indirectlylit opened this issue Jan 29, 2019 · 9 comments · Fixed by #12006
Closed
Assignees
Labels
DEV: backend Python, databases, networking, filesystem... help wanted Open source contributors welcome P2 - normal Priority: Nice to have TAG: dev experience Build performance, linting, debugging...

Comments

@indirectlylit
Copy link
Contributor

indirectlylit commented Jan 29, 2019

Observed behavior

This appears to be due to a browserstack limitation: https://www.browserstack.com/question/758

As a workaround, http://kolibribeta.learningequality.org works fine

Browserstack reports:

image

We see:

image

Expected behavior

Kolibri should load

User-facing consequences

unable to use on iOS

Errors and logs

from Browserstack console:

image

Steps to reproduce

load kolibri on safari browserstack:

image

Note that you need to enter your local network IP address, not localhost on iOS. Or just use http://kolibribeta.learningequality.org

Context

#4589 looks related

k0.12

browserstack device info:

image

@jonboiser
Copy link
Contributor

I just tried this out, and it still seems to be an issue for running the webpack devserver. However, the workaround we've been using is to just rebuild the app manually and run the django webserver, using these two steps

yarn run build
kolibri manage --debug runserver -- 0.0.0.0:8000
# Kolibri is accessible at bs-local.com:8000 on browserstack iOS emulators

@rtibbles
Copy link
Member

rtibbles commented Nov 3, 2020

One other way around it would be to build in watch mode, but write to disk (but only in this circumstance). This would be a bit slower than the regular watch mode, but quicker than doing a full build each time.

@jonboiser
Copy link
Contributor

What's the command for running in watch mode?

@rtibbles
Copy link
Member

rtibbles commented Nov 3, 2020

We'd have to expose an extra flag on the kolibri-tools build CLI to enable this I think, one that just writes the files to disk instead of using the webpack-dev-server.

@rtibbles
Copy link
Member

rtibbles commented Nov 3, 2020

(webpack dev server is the more customisable version of webpack's watch mode)

@indirectlylit indirectlylit changed the title cannot load locally-hosted kolibri on iOS in browesrstack cannot load locally-hosted kolibri on iOS in browserstack Nov 4, 2020
@jonboiser jonboiser added the safari Limited to safari or webkit label Mar 25, 2021
@rtibbles rtibbles changed the title cannot load locally-hosted kolibri on iOS in browserstack Add write-to-disk watch mode for kolibri tools to allow single origin dev testing. Aug 17, 2021
@rtibbles rtibbles added DEV: backend Python, databases, networking, filesystem... and removed OS: iOS safari Limited to safari or webkit labels Aug 17, 2021
@rtibbles rtibbles added the P2 - normal Priority: Nice to have label Aug 30, 2021
@rtibbles
Copy link
Member

rtibbles commented Jan 3, 2024

This should be implemented by adding a --write-to-disk flag to build command: https://github.com/learningequality/kolibri/blob/release-v0.16.x/packages/kolibri-tools/lib/cli.js#L201

that only has an effect when running in dev mode. This would skip using the webpack devserver, and would instead write to disk, but still using watch mode.

When using this mode, it should also add a console.warning to tell the user that frequent changes in this mode may fill up their developer machine with lots of different built files.

@rtibbles rtibbles added the help wanted Open source contributors welcome label Jan 3, 2024
@thesujai
Copy link
Contributor

May i have this assigned?

@thesujai
Copy link
Contributor

thesujai commented Mar 19, 2024

I have to run the runWebpackBuild with ,devserver cache and hot as false right in --write-to-disk option?

@rtibbles
Copy link
Member

Yes - hot reloading requires the webpack devserver, which this would not be using. I will assign you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend Python, databases, networking, filesystem... help wanted Open source contributors welcome P2 - normal Priority: Nice to have TAG: dev experience Build performance, linting, debugging...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants