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

Adding initial files with limited functionality support for OXC in Elixir #1

Merged
merged 10 commits into from
Dec 24, 2024

Conversation

shahryarjb
Copy link
Collaborator

@shahryarjb shahryarjb commented Dec 21, 2024

Goal

The goal of this pull request is to add functionalities related to JavaScript manipulation, aiming to enable its use with Igniter in Mix tasks (based on ash-project/igniter#106).


Description

As discussed in the Ash Discord, this requires some configuration and optimizations. Please apply the necessary changes based on the requirements.

For instance, precompiling beforehand to avoid taking up significant time from the user each time is a good example. Additionally, this should be handled based on the user's operating system.

Here’s an example:
https://github.com/tessi/wasmex/blob/main/.github/workflows/release.yml

And also in the Elixir section:
https://github.com/tessi/wasmex/blob/main/lib/wasmex/native.ex#L8-L24

The module related to the JavaScript parser: lib/igniter_js/parsers/javascript/parser.ex

And the test module: test/parsers/javascript/parser_test.exs

Let me reiterate that I haven’t made any changes to the mix file or the README so that you can adjust them according to your own policies.


My short-term goal is to maintain these functions as they are. Over time, I plan to add other OXC functions based on improved personal experience to make working with JavaScript easier.

Best regards,
Shahryar Tavakkoli

@zachdaniel
Copy link
Contributor

This looks great! I'll merge this as it is and set it up to be one of our projects. The effort to set it up for recompilation etc. is not something I will be able to put in personally until I have something that I need to use igniter_js for, which I'm sure will happen some day soon :)

Our original case was for adding an export to tailwind.config.js but that is going away in tailwind 4 😆

I will be doing some js codegen work in the near future though and will look into precompilation.

@zachdaniel zachdaniel merged commit 3321251 into ash-project:main Dec 24, 2024
@shahryarjb shahryarjb deleted the first-version-of-oxc branch December 24, 2024 15:12
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.

2 participants