Skip to content

BREAKING CHANGE: GAUD-9693 - Remove CommonJS and superagent#69

Open
svanherk wants to merge 5 commits intomasterfrom
GAUD-9693-esm-only-and-remove-superagent
Open

BREAKING CHANGE: GAUD-9693 - Remove CommonJS and superagent#69
svanherk wants to merge 5 commits intomasterfrom
GAUD-9693-esm-only-and-remove-superagent

Conversation

@svanherk
Copy link
Copy Markdown
Contributor

As discussed with @dlockhart and @bearfriend , instead of updating everyone to v9 (which was causing some errors because of the CommonJS change and trying to support both it and ESM), we wanted to modernize the repo a bit and do another breaking change where we:

  1. Drop CommonJS and only support ESM
  2. Delete the superagent stuff (no longer necessary and is encouraged to be removed everywhere).

node-version-file: .nvmrc
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is now set in the .npmrc file.

Comment thread package.json
@@ -1,16 +1,14 @@
{
"name": "siren-parser",
"version": "9.2.3",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Merging this is gonna bypass everyone's "ignore v9 for Dependabot" exemptions they've added. So we'll want to move quickly after that.

@svanherk svanherk marked this pull request as ready for review April 10, 2026 18:46
@svanherk svanherk requested a review from ryantmer as a code owner April 10, 2026 18:46
@svanherk svanherk requested a review from a team April 10, 2026 18:46
Comment thread README.md Outdated
Comment on lines +22 to +23
Entity.prototype.printEntity = function() { console.log(this) };
var parsedEntity = SirenParse('{"class":["foo","bar"]}'); // parsedEntity will have printEntity()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know if we want to encourage modifying the prototype like this as I think it'd affect everyone else's usage. Maybe show a way to just create a new class that extends the base class and adds the method?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So this is currently in the README and was apparently added for UCE. But UCE doesn't actually do this anymore, because it is stuck on v8 like everyone else.

So yeah, we can either just not even mention this, or I can rewrite it as a class extension.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's not mention it. 🤫

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looking back at my DMs with Marc about this, it was 100% made of hacks and none of the solutions either of us came up with made us particularly happy... so I will be happy to see it gone 😄

Comment thread README.md Outdated
```html
<script type="module" src="siren-parser/global.js"></script>
<script>
var parsedEntity = D2L.Hypermedia.Siren.Parse('{"class":["foo","bar"]}');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ew, are people from BSI using this? Can we kill it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but not a lot and we likely can kill it. I'll take a look.

Copy link
Copy Markdown
Collaborator

@ryantmer ryantmer left a comment

Choose a reason for hiding this comment

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

A ceremonial approval since I recognize there's more to come, but this will be a lovely improvement. I had just started looking into somehow getting everybody onto 9 recently (as I realized I'd been merging dependabot updates that nobody was actually benefitting from 🙃), but bumping to 10 makes a lot more sense 👍

Comment thread README.md Outdated
Comment on lines +22 to +23
Entity.prototype.printEntity = function() { console.log(this) };
var parsedEntity = SirenParse('{"class":["foo","bar"]}'); // parsedEntity will have printEntity()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looking back at my DMs with Marc about this, it was 100% made of hacks and none of the solutions either of us came up with made us particularly happy... so I will be happy to see it gone 😄

Copy link
Copy Markdown
Member

@dlockhart dlockhart left a comment

Choose a reason for hiding this comment

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

🎉

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.

4 participants