Skip to content

Remove draft notation for map constructor entries #2887

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

Closed
joewiz opened this issue Jul 19, 2019 · 11 comments · Fixed by #2890
Closed

Remove draft notation for map constructor entries #2887

joewiz opened this issue Jul 19, 2019 · 11 comments · Fixed by #2890

Comments

@joewiz
Copy link
Member

joewiz commented Jul 19, 2019

What is the problem

The draft syntax for map entries is still supported in eXist, which allows users to write bad code.

A major version such as 5.0 would be a good opportunity to remove this syntax—just as we removed other draft-era functions like map:new.

What did you expect

Map constructor entry syntax is as follows: https://www.w3.org/TR/xquery-31/#prod-xquery31-MapConstructorEntry

However, according to http://exist-db.org/exist/apps/doc/xquery#legacy-features:

Map notation: During the drafting of XQuery 3.0, the specification changed slightly and so did the implementation in eXist-db. To keep backwards compatibility, eXist allows the older notation in map constructors: key:=value in addition to the new one, key: value.

Describe how to reproduce or add a test

Code such as map { "name" := "joe" } should raise an error.

Context information

  • eXist-db version: current 4.x and 5.x
  • Java version: n/a
  • Operating system: n/a
  • 32 or 64 bit: n/a
  • How is eXist-db installed? n/a
  • Any custom changes in e.g. conf.xml: n/a
@joewiz joewiz added this to the eXist-5.0.0-RC8 milestone Jul 19, 2019
@ghost ghost added the triage issue needs to be investigated label Jul 19, 2019
@ghost ghost removed the triage issue needs to be investigated label Jul 19, 2019
@adamretter
Copy link
Contributor

@joewiz Seems like a good idea to me

@joewiz
Copy link
Member Author

joewiz commented Jul 22, 2019

As @duncdrum mentioned during the Community Call, this PR would require a new release of shared-resources, since the HTML templating module contains one use of the old syntax: https://github.com/eXist-db/shared-resources/blob/master/content/templates.xql#L94-L97.

Also, many HTML templating apps' view.xql files would need to be updated, e.g., https://gitlab.existsolutions.com/tei-publisher/tei-publisher-app/blob/master/modules/view.xql#L26-29.

@duncdrum
Copy link
Contributor

duncdrum commented Jul 22, 2019

exide's app-generator uses the proper syntax since 2016, generator apps always used the correct syntax in view.xql.
I think this counts as sufficient time, for users to escape the tyranny of the defaults.
@wolfgangmm I would still prefer if we'd use this opportunity to decouple html-templating from shared resources, and turn it into its own library package.

joewiz added a commit to joewiz/shared-resources that referenced this issue Jul 23, 2019
joewiz added a commit to joewiz/demo-apps that referenced this issue Jul 23, 2019
joewiz added a commit to joewiz/function-documentation that referenced this issue Jul 23, 2019
joewiz added a commit to HistoryAtState/hsg-shell that referenced this issue Jul 23, 2019
joewiz added a commit to HistoryAtState/tumblr that referenced this issue Jul 23, 2019
joewiz added a commit to HistoryAtState/twitter that referenced this issue Jul 23, 2019
joewiz added a commit to joewiz/monex that referenced this issue Jul 23, 2019
joewiz added a commit to joewiz/public-repo that referenced this issue Jul 23, 2019
joewiz added a commit to wolfgangmm/tei-simple-pm that referenced this issue Jul 23, 2019
@line-o
Copy link
Member

line-o commented Jul 23, 2019

@joewiz oh wow, this beauty is hiding in a lot more places than I thought.

joewiz added a commit to joewiz/website that referenced this issue Jul 23, 2019
joewiz added a commit to joewiz/xsltforms-demo-app that referenced this issue Jul 23, 2019
@joewiz
Copy link
Member Author

joewiz commented Jul 23, 2019

@line-o Sure is! The most common culprit is view.xql of HTML Templating apps. I wonder if @craigberry could figure out a way to extend his code audit script to find these. I used the regex map\s*\{[^\}]+?:= over all of the XQuery files stored on my system. There were some false positives, but on the whole, it helped.

joewiz added a commit to joewiz/messaging-replication that referenced this issue Jul 23, 2019
@joewiz
Copy link
Member Author

joewiz commented Jul 23, 2019

@line-o I've completed reviewing the 18 eXist-db organization repositories with a view.xql file https://github.com/search?utf8=%E2%9C%93&q=org%3AeXist-db+filename%3Aview.xql&ref=simplesearch.

I have not reviewed:

Unfortunately, GitLab doesn't support searching by filename, but I've already submitted a PR for tei-publisher: https://gitlab.existsolutions.com/tei-publisher/tei-publisher-app/merge_requests/73.

joewiz added a commit to joewiz/documentation that referenced this issue Jul 23, 2019
@joewiz
Copy link
Member Author

joewiz commented Jul 24, 2019

FYI, the previous behavior has been in place since this PR, which was released in eXist 2.2: #320.

@joewiz
Copy link
Member Author

joewiz commented Jul 24, 2019

New releases of the following stock apps have been published to the public repo:

  • dashboard v2.0.2
  • shared-resources v0.8.4
  • monex v2.0.3

The following apps have PRs that need to be merged before a release can be cut:

No changes to packageservice, functx, or markdown were needed.

I published new releases of the following non-core apps:

  • public repo v0.8.3
  • demo v0.4.3
  • xsltforms-demo v0.1.5
  • tei-pm v1.1.4

My PRs updating one other non-core app still needs review - and should be included in the next release of the app:

@joewiz
Copy link
Member Author

joewiz commented Jul 24, 2019

joewiz added a commit to joewiz/function-documentation that referenced this issue Jul 24, 2019
joewiz added a commit to joewiz/documentation that referenced this issue Jul 24, 2019
joewiz added a commit to joewiz/documentation that referenced this issue Jul 24, 2019
@joewiz
Copy link
Member Author

joewiz commented Jul 24, 2019

Other repositories with the same PR that will need new releases:

I started a PR for AtomicWiki but then discovered it needed quite a bit more work to account for the removed functions. I pasted in the full audit, in case anyone is willing to complete the work:

joewiz added a commit to HistoryAtState/hsg-shell that referenced this issue Jul 24, 2019
@joewiz
Copy link
Member Author

joewiz commented Jul 25, 2019

Thanks to help from @dizzzz, I've just released:

  • Function Documentation v1.1.1
  • JFreeChart v0.5.0

This leaves only:

duncdrum pushed a commit to eXist-db/documentation that referenced this issue Jul 31, 2019
duncdrum pushed a commit to eXist-db/documentation that referenced this issue Jul 31, 2019
wolfgangmm pushed a commit to eeditiones/vangogh that referenced this issue May 28, 2020
windauer pushed a commit to windauer/ws21-tp7-ws that referenced this issue Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants