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 offline support #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add offline support #153

wants to merge 1 commit into from

Conversation

kentcdodds
Copy link
Contributor

This commit updates the webpack.config.js file to use the OfflinePlugin by @NekR so I can get to and use ASTExplorer.com on the airplane :)

Will require additional changes (for example). I'm mostly opening this as a PR rather than an issue to discuss it :)

This commit updates the `webpack.config.js` file to use the `OfflinePlugin` by @NekR so I can get to and use ASTExplorer.com on the airplane :)

Will require additional changes ([for example](kentcdodds/es6-todomvc@FEM/06.2-extract-css...FEM/07.0-offline)). I'm mostly opening this as a PR rather than an issue to discuss it :)
@NekR
Copy link

NekR commented Sep 19, 2016

Just a side note about this: kentcdodds/es6-todomvc@FEM/06.2-extract-css...FEM/07.0-offline#diff-fc1b37867580a192c480780240064424R28

You may just remove new OfflinePlugin() from webpack.config in a dev mode, if that makes sense. The result will be the same as with your solution.

@kentcdodds
Copy link
Contributor Author

Oh really? What will happen with my call to offlineInstall?

@NekR
Copy link

NekR commented Sep 19, 2016

It will work and write a warning into browser's console that you could
forget to add the plugin to your config. If you care what it will include
in a bundle -- nothing except of a warning.

Here is the content of the runtime by default:
https://github.com/NekR/offline-plugin/blob/master/runtime.js

When you add offline-plugin into the config, it automagically serves real
runtime for you.

On Sep 19, 2016 23:12, "Kent C. Dodds" [email protected] wrote:

Oh really? What will happen with my call to offlineInstall?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#153 (comment),
or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABIlkddIfcpLaRcvPVMQoFzgSnHFfvBZks5qruyTgaJpZM4KArPi
.

@NekR
Copy link

NekR commented Sep 19, 2016

Though, I already have reports what that warning is a bit annoying, so I'm
going to so something with it in a next release.

On Sep 19, 2016 11:39 PM, "Arthur Stolyar" [email protected] wrote:

It will work and write a warning into browser's console that you could
forget to add the plugin to your config. If you care what it will include
in a bundle -- nothing except of a warning.

Here is the content of the runtime by default: https://github.com/NekR/
offline-plugin/blob/master/runtime.js

When you add offline-plugin into the config, it automagically serves real
runtime for you.

On Sep 19, 2016 23:12, "Kent C. Dodds" [email protected] wrote:

Oh really? What will happen with my call to offlineInstall?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#153 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABIlkddIfcpLaRcvPVMQoFzgSnHFfvBZks5qruyTgaJpZM4KArPi
.

@fkling
Copy link
Owner

fkling commented Sep 20, 2016

This is a great idea! Ever since I heard about the plugin I thought about using it for astexplorer. What else specifically do we have to do?

@kentcdodds
Copy link
Contributor Author

Well, I heard that there's some integration with Parse.com somewhere. But I think for this first iteration it would be enough to just be able to use the tool, even if it means you can't save what you're working on.

So I'm pretty certain that all you'd need to do is add this snippet of code to somewhere in the project (most likely somewhere around the bootstrapping phase of the app):

import {install as offlineInstall} from 'offline-plugin/runtime'
offlineInstall()

Pretty sure that's it... Maybe further down the road we can disable the "Save" button when you're offline and then add the option to save to localStorage.

@gabro
Copy link
Contributor

gabro commented Jun 26, 2017

Hi guys, is there any update on this? It looks promising and I was wondering whether I can help :)

@kentcdodds
Copy link
Contributor Author

No update. I'm sure a more thorough PR would be appreciated. I know I would love it!

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.

4 participants