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

Normative optional, legacy -> Deprecated #133

Merged
merged 10 commits into from
Apr 21, 2023

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Mar 22, 2023

PR preview: https://nicolo-ribaudo.github.io/proposal-import-assertions

As per the March 2023 TC39 meeting, this pull request changes the assert compatibility fallback from "Normative optional, legacy" to "Deprecated", with this description:

A conforming implementation of ECMAScript should not implement Deprecated subclauses, unless necessary for compatibility with existing applications that already run in such implementation before the deprecation of the given language feature. All of the language features and behaviours specified within Deprecated subclauses have one or more undesirable characteristics. However, their usage in existing applications currently prevents their removal from this specification. These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code.

(old description I first used)

A conforming implementation of ECMAScript should not implement Deprecated subclauses. All of the language features and behaviours specified within Deprecated subclauses have one or more undesirable characteristics. However, their usage in existing applications currently prevents their removal from this specification. These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code.

For comparison, the "Legacy" description is

A conforming implementation of ECMAScript must implement Legacy subclauses, unless they are also marked as Normative Optional. All of the language features and behaviours specified within Legacy subclauses have one or more undesirable characteristics. However, their continued usage in existing applications prevents their removal from this specification. These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code.

Additionally, I added two notes mentioning that removal of assert is being investigated.

cc @ljharb @msaboff

spec.emu Outdated Show resolved Hide resolved
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

i like it!

@ljharb
Copy link
Member

ljharb commented Mar 23, 2023

cc @tc39/ecma262-editors and @syg in particular

spec.emu Outdated Show resolved Hide resolved
spec.emu Outdated
@@ -121,7 +124,7 @@
1. Return _promiseCapability_.[[Promise]].
1. Let _assertionsObj_ be Completion(Get(_options_, *"with"*)).
1. IfAbruptRejectPromise(_assertionsObj_, _promiseCapability_).
1. [normative-optional-legacy=""] If _assertionsObj_ is *undefined*, then
1. [deprecated=""] If _assertionsObj_ is *undefined*, then
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a "deprecated subclause". We should probably just have a NOTE step here that gets replaced in a deprecated subclause, much like what we do in Annex B. Search for "replaces-step" for examples to copy.

Copy link
Member Author

@nicolo-ribaudo nicolo-ribaudo Mar 31, 2023

Choose a reason for hiding this comment

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

I was following the path introduced by tc39/ecma262#2952, which inlines Annex B changes to the algorithms rather than replacing NOTE steps out-of-band.

I could update the description of "deprecated" to be "deprecated subclause, step, or production", or I could update this step to be

1. If the host supports the deprecated assert keyword for import attributes and if _assertionsObj_ is *undefined*, then

with "assert keyword for import attributes" linking to an actual deprecated emu-clause that explains what it is.

What do you think about these two options? I would also be happy to join an editors call if needed.

(I pushed a commit to separate the grammar into its own clause, since that ecma262 PR doesn't inline the grammar changes)

Copy link
Member Author

Choose a reason for hiding this comment

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

Wdyt about this?
image

Copy link
Member

Choose a reason for hiding this comment

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

@nicolo-ribaudo We'll discuss it during this week's editor call. Feel free to join.

spec.emu Outdated Show resolved Hide resolved
Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

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

Wording for dfn of deprecated LGTM, but we need to work on the mechanics of actually applying it, as I've described in my comments.

@ljharb
Copy link
Member

ljharb commented Apr 4, 2023

It'd be great to land this so i can review a spec that includes it :-)

@michaelficarra
Copy link
Member

@ljharb We're gonna talk about it in editor call tomorrow.

@nicolo-ribaudo
Copy link
Member Author

nicolo-ribaudo commented Apr 6, 2023

@tc39/ecma262-editors I pushed e1a16a2 based on yesterday's discussion.

Preview of this PR: https://nicolo-ribaudo.github.io/proposal-import-assertions

spec.emu Outdated Show resolved Hide resolved
spec.emu Outdated Show resolved Hide resolved
spec.emu Outdated
<li>It is a Syntax Error if AllImportAttributesSupported(WithClauseToAttributes of |AssertClause|) is *false*.</li>
</ul>

<p>The static semantics of WithClauseToAttributes in <emu-xref href="#sec-with-clause-to-attributes"></emu-xref> are augmented with the following:</p>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's unclear that we're inserting these (as opposed to replacing the existing ones), but I think I'd prefer to be more explicit with wording like

Suggested change
<p>The static semantics of WithClauseToAttributes in <emu-xref href="#sec-with-clause-to-attributes"></emu-xref> are augmented with the following:</p>
<p>The static semantics of WithClauseToAttributes in <emu-xref href="#sec-with-clause-to-attributes"></emu-xref> are augmented to include the following:</p>

Also, since we are disallowing these AssertClause nodes from being parsed in the first place using early errors, we don't technically need these definitions to be conditional. We could just put them in WithClauseToAttributes. @tc39/ecma262-editors thoughts?

Copy link
Member Author

@nicolo-ribaudo nicolo-ribaudo Apr 13, 2023

Choose a reason for hiding this comment

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

I think it's nice to keep the deprecated feature as much self contained as possible, rather than scattered across different parts of the spec. If a spec reader doesn't care about it, it's much easier to skip when reading.

spec.emu Outdated Show resolved Hide resolved
@bakkot
Copy link
Contributor

bakkot commented Apr 7, 2023

Just published ecmarkup 16.2.0, which supports 1. [normative-optional, deprecated] Stuff step labels.

@nicolo-ribaudo
Copy link
Member Author

Thanks, updated!

@nicolo-ribaudo
Copy link
Member Author

@tc39/ecma262-editors I plan to merge this PR during the weekend, if there aren't other problems with the changes it introduces. I'd like to get the published spec text (https://tc39.es/proposal-import-attributes/) to its final form to facilitate reviews (#137).

@nicolo-ribaudo nicolo-ribaudo merged commit 99ee2c3 into tc39:master Apr 21, 2023
@nicolo-ribaudo nicolo-ribaudo deleted the deprecated branch April 21, 2023 12:19
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