rhettlunn / is-odd-ai

Why check if something is odd simply, when you can do it with ✨AI✨
Apache License 2.0
295 stars 9 forks source link

Polyfill ES1 #3

Open stefanofa opened 5 days ago

stefanofa commented 5 days ago

It may be more appropriate and beneficial to implement a build process, rather than exporting the source code directly. This would allow for the addition of polyfills to support ES1.

laino commented 4 days ago

What if we had AI write the code as part of the build process, rather than maintaining it in the repository? We could ask it to include ES1 support.

rhettlunn commented 4 days ago

Thank you @stefanofa and @laino for your interesting suggestions! Let's address both ideas:

  1. Implementing a build process with polyfills for ES1 support

@stefanofa, you're right that implementing a build process could be beneficial. It would allow us to use modern JavaScript features in development while ensuring compatibility with older environments. Here's a potential approach:

This approach would maintain the readability of our source code while ensuring wide compatibility.

  1. Using AI to generate ES1-compatible code during the build process

@laino, your idea of using AI to write ES1-compatible code as part of the build process is intriguing and fits well with the theme of our package! Here's how we might implement this:

Considerations:

Given these considerations, we might want to use this as an optional build step or for occasional "translation" of our code to ES1, rather than for every build.

Next steps:

  1. Decide which approach (or combination) we want to pursue
  2. Create a detailed implementation plan
  3. Update our contribution guidelines to reflect the new build process

What do you think? Should we start with a traditional build process and consider the AI approach as a future enhancement? Or are you excited to dive into the AI-powered build process right away?

We'd love to hear more thoughts from the community on this! 🤖🛠️