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

Update to working open, switch to ESM #499

Merged
merged 3 commits into from
Feb 15, 2025
Merged

Conversation

flying-sheep
Copy link
Contributor

@flying-sheep flying-sheep commented Feb 13, 2025

See #498

I regenerated all the autogenerated files, but there was an issue with demangle.wasm.js: It also generated the module.exports = Module; module.exports.default = Module lines for some reason, so I manually deleted them.

If you know how to make it only emit ESM exports and leave out the CommonJS exports, I can add that to the makefile.

@jlfwong
Copy link
Owner

jlfwong commented Feb 13, 2025

Hey, unless I'm misunderstanding something important, updating to a version of open that works for you does not require all files be updated to esm — only the bin/cli.js script.

I'd prefer to keep this change as minimally scoped as possible.

Also, it would be helpful to understand the nature of the existing version of open not working for you. What errors are you seeing with the existing version of open?

@flying-sheep
Copy link
Contributor Author

flying-sheep commented Feb 13, 2025

It doesn’t support Plasma 6, so it’s completely useless and does nothing. Only version 10 is fixed, since it ships xdg-open 2.1.2, which supports Plasma 6.

@flying-sheep
Copy link
Contributor Author

OK, done. That requires renaming the CLI file, but of course that has much less impact than making everything ESM

@coveralls
Copy link

coveralls commented Feb 14, 2025

Coverage Status

coverage: 43.731%. first build
when pulling c84aded on flying-sheep:pa/esm
into e3d57d5 on jlfwong:main.


urlToOpen = `file://${htmlPath}`
urlToOpen = `file://${htmlPath}`
}
}
Copy link
Owner

@jlfwong jlfwong Feb 14, 2025

Choose a reason for hiding this comment

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

I've only actually tested this on OS X, so it's possible this issue exists for other platforms too.

To minimize the possibility of breakage, can we maintain this without the process.platform check?

If you'd like to avoid this step on the specific platform you're using, I'm also open to skipping this step on any platforms you can test.

Copy link
Contributor Author

@flying-sheep flying-sheep Feb 15, 2025

Choose a reason for hiding this comment

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

The open package has 3 platform branches: 'win32', 'darwin', and else. This means it tries to use xdg-open on all platforms that aren’t windows or macOS.

I tried on Windows, and indeed, the hash was also stripped, so now it only skips the workaround for platforms using xdg-open (Linux and I guess BSDs and so on)

@jlfwong
Copy link
Owner

jlfwong commented Feb 14, 2025

Thanks for minimizing the surface area of this change! One more small tweak to that effect then this should be good to land

@flying-sheep
Copy link
Contributor Author

OK, done! You were right about your platform concerns, I adapted my change.

@jlfwong jlfwong merged commit 0e153f0 into jlfwong:main Feb 15, 2025
6 checks passed
@jlfwong
Copy link
Owner

jlfwong commented Feb 15, 2025

@flying-sheep Thanks! This is published on npm as part of speedscope@v1.22.1 and later

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.

3 participants