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

test node 12 #324

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

test node 12 #324

wants to merge 6 commits into from

Conversation

cesine
Copy link
Contributor

@cesine cesine commented Jul 17, 2020

for FieldDB/FieldDB#2173

Before Node 8 and Node 10: https://travis-ci.org/github/FieldDB/dative/jobs/708989910

Running "eco:files" (eco) task
File .tmp/scripts/templates/active-server.js created.
File .tmp/scripts/templates/add-user.js created.
File .tmp/scripts/templates/alert-dialog.js created.
File .tmp/scripts/templates/app.js created.
File .tmp/scripts/templates/application-settings-edit.js created.
File .tmp/scripts/templates/application-settings-header.js created.
File .tmp/scripts/templates/application-settings-view.js created.
File .tmp/scripts/templates/application-settings.js created.
File .tmp/scripts/templates/basepage.js created.
File .tmp/scripts/templates/button-control.js created.
File .tmp/scripts/templates/collection-contents-input.js created.
File .tmp/scripts/templates/comment-representation.js cre
...

After Node 12 : https://travis-ci.org/github/FieldDB/dative/jobs/708989911

Screen Shot 2020-07-17 at 4 27 11 PM


Running "eco:files" (eco) task
File .tmp/scripts/templates/active-server.js created.
File .tmp/scripts/templates/add-user.js created.
File .tmp/scripts/templates/alert-dialog.js created.
File .tmp/scripts/templates/app.js created.
File .tmp/scripts/templates/application-settings-edit.js created.
File .tmp/scripts/templates/application-settings-header.js created.
File .tmp/scripts/templates/application-settings-view.js created.
>> Error in app/scripts/templates/application-settings.eco:
>> [stdin]:95:24: error: unexpected end of input
>>     _print _safe '\n' +
>>
Warning: Eco failed to compile app/scripts/templates/application-settings.eco. Use --force to continue.

fix 
>> Error in app/scripts/templates/application-settings.eco:
>> Parse error on line 106: unexpected dedent


Aborted due to warnings.

List of impacted files:

app/scripts/templates/application-settings.eco
app/scripts/templates/csv-import-header.eco
app/scripts/templates/file-data.eco
app/scripts/templates/filter-expression.eco
app/scripts/templates/form-add-widget-backup.eco
app/scripts/templates/keyboard-input.eco
app/scripts/templates/resource.eco
app/scripts/templates/settings.eco
app/scripts/templates/smart-query-preview.eco

Root cause appears that all of these files have nested <% when i remove it or workaround it, the file is able to compile:

Screen Shot 2020-07-17 at 3 58 18 PM

I think i found that i can reproduce this in eco's test suites using 1.0.3 but using the latest version v1.1.0-rc-3 works so upgrading to the latest might be a direction we can go in but it requires an update to grunt-eco to handle the breaking change where compile now returns a function

Option 1: fix the compile issue

  1. Use josh-lauer and other's work to escape characters to prevent a cross site scripting issue, which also fixes the templates https://github.com/cesine/eco/pull/8/files
  2. Optional: Use a new version of nodeunit which can support coffeescript instead of coffee-script https://github.com/caolan/nodeunit/pull/358/files
  3. TBD Use a new version of grunt-eco https://github.com/cesine/grunt-eco/pull/1/files which can support the new compile which returns a function sstephenson/eco@v1.0.3...v1.1.0-rc-3

Option 2: check in the dist

If we cant build on the server, we can build using node 10 and then check in the dist and serve those using node 12 FieldDB#16

Option 3: convert from coffee to js

There is probably a util that we can use to convert all the coffee files into es6. i did a POC using decaffeinate but it would require more work to update the gruntfile to use eslint and another templating engine that is similar to eco FieldDB#17

to find which version of node might have been the start of the issue
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.

1 participant