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

refactor: made adding a new loader easier #155

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

KilianKilmister
Copy link
Contributor

No description provided.

@KilianKilmister KilianKilmister marked this pull request as draft July 12, 2020 20:57
@KilianKilmister
Copy link
Contributor Author

referencing my comment in #133

turned out to be a very small change.

  • js/cjs are loaded with dynamic import
  • other ext are mapped against an object 0f {[exst: string] (src: string) => object} (which currently just contains '.json': JSON.parse)
  • if ext doesn't have a mapping it falls back to the JSON.parse

@toddbluhm
Copy link
Owner

This is a very cool PR. I like the simplicity of it + the clarity it adds. Would make it a lot easier to support more file extensions.

@KilianKilmister
Copy link
Contributor Author

@toddbluhm awesome-sauce, I believe the tests only failed because i didn't pre-lint, so thats easily fixable. Now it's been a while since i wrote this and I'm still dealing with the aftermath of a corrupted system-drive on my main machine, so rewisiting the code won't be ultra swift, but i'll take your response as a green-light on polishing this up.

Want me to include YAML and/or JSON5 suport rightaway aswell? I'd suggest to include both, but it's your call.

@k-yle
Copy link
Collaborator

k-yle commented Sep 11, 2020

Any update on this? I'm happy to help get this merged if required. We would really like to use json with comments.

@toddbluhm if you're concerned about adding another dependency you could make it a peerDependency and/or just have a helpful error message if the user tries to use jsonc without that dependency installed. I'm happy to make a PR for this. facebook's create-react-app uses this approach

@k-yle k-yle marked this pull request as ready for review December 11, 2024 07:34
k-yle
k-yle previously approved these changes Dec 11, 2024
Copy link
Collaborator

@k-yle k-yle left a comment

Choose a reason for hiding this comment

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

thanks for the PR! I've rebased it to resolve conflicts, since there's been a lot of refactoring lately

Co-authored-by: KilianKilmister <KilianKilmister@users.noreply.github.com>
Copy link
Owner

@toddbluhm toddbluhm left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for getting this updated.

Also just to make sure, @k-yle you can still merge these branches without PR approval correct? I want to make sure you can in case I am ever MIA for a bit again (I don't plan to be, but you never know). Also, I will get you NPM access soon.

@k-yle
Copy link
Collaborator

k-yle commented Dec 16, 2024

awesome, thanks @toddbluhm - Currently, I can merge other peoples' PRs, but not my own PRs. This seems reasonable; assuming there are always 2 active maintainers

@k-yle k-yle merged commit 8c55ce6 into toddbluhm:master Dec 16, 2024
9 checks passed
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