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

Allow generating sourcemaps for Lua in the same format as JS #11454

Merged
merged 1 commit into from Dec 29, 2023
Merged

Allow generating sourcemaps for Lua in the same format as JS #11454

merged 1 commit into from Dec 29, 2023

Conversation

Zorbn
Copy link
Contributor

@Zorbn Zorbn commented Dec 29, 2023

Lua tools (Local Lua Debugger, TypescriptToLua, etc) commonly use the same format for sourcemaps as JS does. This PR moves code specific to generating JS-style sourcemaps into jsSourcemap.ml then uses that code to implement sourcemaps for Lua.

@Simn
Copy link
Member

Simn commented Dec 29, 2023

I think the original plan was to have all the generic sourcemap functionality in sourcemaps.ml. I really like the separation from genjs.ml regardless though, and if lua sourcemaps are so similar it makes sense to handle it like that.

@Zorbn
Copy link
Contributor Author

Zorbn commented Dec 29, 2023

Lua and JavaScript sourcemaps are pretty much identical because they follow the Source Map Revision 3 spec. PHP is the language using sourcemaps.ml right now and I don't know much about PHP. If their sourcemaps also follow the same spec then sourcemaps.ml and jsSourcemap.ml could be combined. Of course then sourcemaps.ml would be pretty JavaScript centric since it would be supporting 3 types of sourcemaps based on a JavaScript spec. Maybe that's ok if there aren't any other types of sourcemaps we would need to support (I don't even know if other types of sourcemaps exist).

@Simn Simn merged commit 3b068a1 into HaxeFoundation:development Dec 29, 2023
61 checks passed
@Simn
Copy link
Member

Simn commented Dec 29, 2023

Thanks!

@RealyUniqueName
Copy link
Member

There's no sourcemap concept in PHP world.
sourcemaps.ml uses JS sourcemap spec.

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.

None yet

3 participants