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

Feature/offline #103

Open
wants to merge 36 commits into
base: develop
Choose a base branch
from
Open

Feature/offline #103

wants to merge 36 commits into from

Conversation

haf
Copy link
Member

@haf haf commented Nov 9, 2016

The aim of the PR is to make FsReveal function without internet access. This means we need to pull in all of the code as a single compilation unit:

  • Compile JS
  • Compile CSS
  • Pull in fonts locally
  • Pull in bootstrap locally
  • Pull in RevealJS locally
  • Ensure we can resolve fonts when running ./build.sh from master, serving with Suave
  • Ensure we can CSS
  • Optimise JS
  • Optimise CSS
  • Upgrade all dependencies
    • Suave
    • FAKE
    • OctoKit
  • Add babel for ECMAScript 6/7 support
  • Add webpack for compilation and working with JS

@haf
Copy link
Member Author

haf commented Nov 9, 2016

What's the way to test if what I've done works? There are no docs what so ever about how to run this thing in dev mode...?

@forki
Copy link
Member

forki commented Nov 9, 2016

good question. did not do this for very long time.

probably by copying things manually in place

@haf
Copy link
Member Author

haf commented Nov 9, 2016

While you have a look at that, here are the main changes:

  • Introduce a new build tool for building compressed JS – http://yarnpkg.com/
  • Change generation to ./dist
  • Change templating to ./dist/index.html which is where https://github.com/ampedandwired/html-webpack-plugin puts it after injecting all the required JS
  • Add OfflinePlugin so that presentations can be presented without even a broken WIFI connection
  • Adding chunking with chunk hashes for long term caching
  • Pulling in reveal.js directly from paket-files, exposing it as a browser global and initialising it
  • Pulling in all currently enabled plugins with Webpack rather than with reveal.js, so that they are turned on by default (needs testing – QA – forki?)
  • I haven't yet found how to start it all (but I'll peruse the build.fsx file shortly)
  • MathJax – I pulled in the node package rather than their CDN (which is failing often for me)
  • Added source maps so that reveal.js can be properly debugged
  • Added source maps for our own new template.js which enabled me to move all logic out of the HTML file.

This will make it:

  • Easier to upgrade reveal.js because all that's needed is to bump the paket dependency; no more manual copying
  • Easier to provide server-side rendering if needed, because it's now loaded through node
  • Easier to track the JS dependencies

QA needed on:

  • Paths and copying files around – needs docs, too
  • Regeneration of slides and injecting them into the file
  • Changing the layout – I may have removed the location where that's templated

Help needed on:

  • The above and also
  • How to start it in dev mode

AFK for a while now; I need to write my presentation too. Which btw I could hold for the F# community too; intro to Kafka.

@forki
Copy link
Member

forki commented Nov 9, 2016

upgrading reveal was always easy.

https://github.com/fsprojects/FsReveal/blob/develop/paket.dependencies#L6
so it was only a git push on the reveal clone (please note we explicitly maintain the fork, since we often are a couple of commits in front of reveal.js master)

@haf
Copy link
Member Author

haf commented Nov 9, 2016

I did notice a strange reveal.js-[GITHASH] folder in the fork; is that where you want me to use the files from? Why not just merge it into the files of the actual repo?

@forki
Copy link
Member

forki commented Nov 9, 2016

suave is taken via paket from nuget.


The node modules take care of bundling all the JS dependencies. You don't need
anything other than Yarn to compile, but some of them are dependent on having a
binary called 'python2' on your PATH.
Copy link
Member

Choose a reason for hiding this comment

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

urgs!?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, the wonderful world of JS dev

Copy link
Member

Choose a reason for hiding this comment

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

why would we need it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know. JS pulls in the world and I'm using the "standard" setup for css/html.

README.md Outdated
`./src/FsReveal/template.{html,js}` is the entry point for webpack during
packaging.

When you've performed a change to the repo, it's all packaged as a nuget. That
Copy link
Member

Choose a reason for hiding this comment

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

"as a NuGet package. That package..."

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

README.md Outdated
# npm install -g yarn
yarn install --ignore-engines
yarn run build
# when you wanna test your changes:
Copy link
Member

Choose a reason for hiding this comment

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

"when you want to"

README.md Outdated
### Dev

```
pyenv local 2.7.10
Copy link
Member

Choose a reason for hiding this comment

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

where is this coming from?

@haf
Copy link
Member Author

haf commented Nov 9, 2016

@kimsk @troykershaw What css file am I missing? Only getting white BG:

screen shot 2016-11-09 at 17 55 01

@kimsk
Copy link
Collaborator

kimsk commented Nov 12, 2016

It looks like the reveal.js css theme is missing. Those files are something like css/theme/night.css in reveal.js.

@haf
Copy link
Member Author

haf commented Nov 13, 2016

@kimsk Thanks; the last two issues are:

  • showTip/hideTip are expected to be globals, rather than composed functions – I've placed the tips.js file inside the bootstrapping file but haven't found where they are being used (need to get on with presentation now!). Any direction towards fixing that would be excellent.
  • The overview mode looks like this when you press O and then right arrow twice:

screen shot 2016-11-13 at 16 41 40

screen shot 2016-11-13 at 16 41 45

@ErikSchierboom
Copy link

I've just tested this on my MacBook, and here are my findings:

  • The README doesn't state that you should run build.cmd or build.sh before running yarn run build. If you don't do that, you get errors like the following error:
ERROR in ./template.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../paket-files/fsprojects/reveal.js/css/reveal.css in /Users/erikschierboom/Programming/FsReveal/src/FsReveal
 @ ./template.js 3:0-64 43:2-66

Having run build.sh first and then the yarn commands fixes it.

  • The README doesn't mention the fact that you can run in watch mode using yarn run watch

  • If I open the dist/index.html file after successfully building, it unfortunately doesn't work. It complains that three files cannot be found:

  • dist/css/custom.css
  • common.<..>.js
  • app.<..>.js

image

@haf
Copy link
Member Author

haf commented Jan 18, 2017

You need to run Suave like in my screenshots above... Could you do that?

@ErikSchierboom
Copy link

@haf Sorry, but how do I do that? If I run a local node http-server, things don't work:

image

I'm a bit confused a to why Suave would be necessary. Wasn't the whole point being that it could run offline?

@haf
Copy link
Member Author

haf commented Jan 19, 2017

Yes, it runs offline from the point of view of your laptop. Just because we start a local web server, we don't have internet.

Today we can't show the presentation without internet.

I'll see what I can whip together in the form of a readme.

@ErikSchierboom
Copy link

@haf Okay, clear. But shouldn't running http-server in the dist directory be working? In my screenshot above, you can see that it didn't.

A readme would be much appreciated!

@haf
Copy link
Member Author

haf commented May 22, 2017

I've updated the READMEs with that information now @ErikSchierboom

@haf
Copy link
Member Author

haf commented May 22, 2017

How to test:

check out the two branches. First build this PR with ./build NuGet then add paket.local in the other PR (see README.md) to point to the new nuget, then do .paket/paket.exe restore to use it. Now you can run ./build in the other PR to run the server.

@haf
Copy link
Member Author

haf commented May 22, 2017

I think it's worth merging now and fixing remaining issues together with the community: e.g. the pretty-printed code lines being slightly off, bumping reveal.js in the fsprojects org and going through its themes, removing downloads from googleapis.com. Also themes and speaker notes aren't really working, but now I have to write my presentation! :)

@ErikSchierboom
Copy link

Thanks @haf!

@dustinlacewell-wk
Copy link

Any chance of this?

@haf
Copy link
Member Author

haf commented Dec 10, 2017

Need someone to pick up the slack. I don't have the bandwidth to complete this refactor (but it's working now, so someone just needs to merge it and test it in full)

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.

6 participants