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

Comments

Projects
2 participants
@ebruchez
Collaborator

ebruchez commented Mar 12, 2014

We crave using Scala on the client!

  • Scala.js is no longer experimental as of early 2015.
  • impact on JS size
    • uncompressed optimized JS for small project w/ e.g. Vector and List: ~200-300 KB
    • compressed: ~70 KB
    • would add ~100 KB for moderate code size on the client
    • could offset some of this by removing some legacy libraries (see #1599, #1249, etc.)
  • 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

This comment has been minimized.

Show comment
Hide comment
@ebruchez

ebruchez Sep 30, 2014

Collaborator

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:

  • Ability to move controls with drag and drop #1479
Collaborator

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:

  • Ability to move controls with drag and drop #1479

@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

This comment has been minimized.

Show comment
Hide comment
@avernet

avernet Oct 17, 2014

Collaborator

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?)

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

@avernet avernet added 1 Point 4 Points and removed 1 Point labels Oct 17, 2014

@ebruchez

This comment has been minimized.

Show comment
Hide comment
@ebruchez

ebruchez Nov 10, 2014

Collaborator

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

Collaborator

ebruchez commented Nov 10, 2014

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

This comment has been minimized.

Show comment
Hide comment
@ebruchez

ebruchez May 13, 2015

Collaborator

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
Collaborator

ebruchez commented May 13, 2015

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

This comment has been minimized.

Show comment
Hide comment
@ebruchez

ebruchez Dec 11, 2015

Collaborator

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.

Collaborator

ebruchez commented Dec 11, 2015

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

This comment has been minimized.

Show comment
Hide comment
@ebruchez

ebruchez Nov 23, 2016

Collaborator

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
Collaborator

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 referenced this issue Dec 9, 2016

Open

Move CoffeeScript code to Scala.js #3035

5 of 21 tasks complete

@ebruchez ebruchez added this to the 2017.1 milestone Jan 19, 2017

@ebruchez

This comment has been minimized.

Show comment
Hide comment
@ebruchez

ebruchez Jan 19, 2017

Collaborator

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 #3090
  • move FormRunnerApp from formRunnerComponents to core or XForms or formRunner
Collaborator

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 #3090
  • move FormRunnerApp from formRunnerComponents to core or XForms or formRunner

@ebruchez ebruchez changed the title from Consider using Scala.js for the client to Integrate Scala.js in the XForms/Form Runner client Jan 19, 2017

@ebruchez ebruchez changed the title from Integrate Scala.js in the XForms/Form Runner client to Integrate Scala.js into the XForms/Form Runner client Jan 19, 2017

ebruchez added a commit that referenced this issue Jan 26, 2017

ebruchez added a commit that referenced this issue Jan 27, 2017

@avernet avernet assigned ebruchez and unassigned avernet Jan 30, 2017

@ebruchez ebruchez closed this Mar 14, 2017

@ebruchez ebruchez added this to Done in Orbeon Forms 2017.1 Apr 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment