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

Integrate Scala.js into the XForms/Form Runner client #1600

Closed
ebruchez opened this issue Mar 12, 2014 · 7 comments
Closed

Integrate Scala.js into the XForms/Form Runner client #1600

ebruchez opened this issue Mar 12, 2014 · 7 comments

Comments

@ebruchez
Copy link
Collaborator

We crave using Scala on the client!

  • Scala.js is no longer experimental as of early 2015.
  • impact on JS size
  • impact on development
    • right now compiled w/ sbt
    • reloads in browser not as instant as with JS/CoffeeScript
    • roundtrip for very small project ~5 seconds to reload w/ Chrome dev tools
  • impact on build system
    • need to figure that out, but build system needs modernization anyway
@ebruchez ebruchez added this to the 4.x (to review) milestone Mar 12, 2014
@ebruchez ebruchez added the Labs label Apr 16, 2014
@ebruchez
Copy link
Collaborator Author

ebruchez commented Sep 30, 2014

The current thinking is to start with Form Builder, which:

  • requires more complex client-side code
  • has higher browser requirements
  • is often installed in controlled environments

Therefore, adding JavaScript code shouldn't be an issue.

Candidate features to investigate:

@avernet avernet removed this from the Review milestone Oct 17, 2014
@ebruchez ebruchez removed this from the Review milestone Oct 17, 2014
@avernet avernet added this to the 4.8 milestone Oct 17, 2014
@avernet
Copy link
Collaborator

avernet commented Oct 17, 2014

I'm tempted to schedule making some progress on this for 4.8, if only because working on this is pretty exciting. (Is that a good or a bad excuse?)

@avernet avernet self-assigned this Oct 17, 2014
@ebruchez
Copy link
Collaborator Author

Update to the "current thinking" above: the admin console could also be a candidate.

@ebruchez ebruchez modified the milestone: 4.8 Nov 17, 2014
@ebruchez
Copy link
Collaborator Author

Some numbers as of 4.9:

  • baseline JS:
    • 221 KB of compressed optimized JS (913 KB non-compressed)
  • Controls form additional JS:
    • 111 KB compressed (348 KB uncompressed)
    • total 332 KB compressed
  • Form Builder additional JS:
    • 180 KB compressed (635 KB uncompressed)
    • total 401 KB compressed

@ebruchez
Copy link
Collaborator Author

As an update, there will be quite a lot of Scala.js in Form Builder (but not Form Runner) in the next version. We'll see what the impact on JavaScript size is, as a new data point.

@ebruchez
Copy link
Collaborator Author

ebruchez commented Nov 23, 2016

Above comment is quite outdated as the Form Builder UI for the workflow feature got written in XForms.

Currently, orbeon-form-builder-client-opt.js:

  • includes some immutable collections like Vector and List
  • weighs 140 KB uncompressed
  • weighs 36 KB compressed!

Things have progressed nicely since March 2014, with files about 1/2 the size (although we are not comparing exactly the same things but hopefully we are not too far off).

Still, it would be good not to duplicate the JavaScript between Form Runner and Form Builder if possible, although that would only impact Form Builder.

Doing this would require something like this:

  • formBuilder project produces its own fastopt
  • formRunner project produces its own fastopt
  • root project (or other) links and produces opt output

Now thinking that the above only makes sense if the additional weight of Form Builder code is very small compared to the rest of the Form Runner code.

So maybe something better, until some kind of code-splitting feature makes it to Scala.js, would be:

  • Form Runner has its own code in a single JavaScript file
  • Form Builder has also a single JavaScript file but which is the result of compiling the Form Builder + the Form Runner code

@ebruchez ebruchez added this to the 2017.1 milestone Jan 19, 2017
@ebruchez
Copy link
Collaborator Author

ebruchez commented Jan 19, 2017

For 2017.1, do baby steps:

  • setup build to include Scala.js for core (XForms, actually) and/or formRunner
    • follow or revisit if needed decision above on Form Builder/Form Runner split
  • make fr:dnd-repeat part of Form Runner
  • fix Summary page loads Form Builder JavaScript #3090
  • move FormRunnerApp from formRunnerComponents to core or XForms or formRunner

@ebruchez ebruchez changed the title Consider using Scala.js for the client Integrate Scala.js in the XForms/Form Runner client Jan 19, 2017
@ebruchez ebruchez changed the title Integrate Scala.js in the XForms/Form Runner client Integrate Scala.js into the XForms/Form Runner client Jan 19, 2017
ebruchez added a commit that referenced this issue Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants