-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
WIP: Attempt to remove the dependencies on fs for browser usage #215
Conversation
b45d2cf
to
731fa1c
Compare
e5a03e2
to
a9810d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice cleanup 🙌
Still testing! 😎 |
Not sure if im doing the browser bundling correctly:
but then i get this error:
Any ideas? |
… arguments `projectId` and `content` as well as an option fileName argument fix: Removed xhr library in favour of ky, and switched request for got for a smaller package size and retry functionality
… latest JS and one for es5.
…ue would be introduced into the url
d4741c5
to
cbeef18
Compare
Finally sorted out the above issue, but ran into another problem. The replacement library Ky, for handling requests has been build to support the latest browsers. I have no issue just supporting the latest browsers for the browser build of this library. That being said, it will still have to be bundled. If we use the default Ky library, we cannot use browserify since it will only work with es5 modules. This leaves a couple options:
Thoughts? |
Don't bother going down the path of compiling Ky and browserify. Most of electron everything apart from Internet explorer supports es6 |
chore: Refactoring url concatenation
Yup! Switched to rollup and everything seems to be working except TrySound/rollup-plugin-terser#11. Hopefully i get that sorted soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM so far
.gitignore
Outdated
@@ -2,3 +2,4 @@ node_modules | |||
npm-debug.log | |||
dist | |||
coverage | |||
.rpt2_cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm maybe .editorconfig
would be good to add and set insert final new line. Your making the next edit harder without final new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestions for a good editorconfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to apply for the whole repo, of course you can apply different rules for each file type: https://editorconfig.org/
root = true
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
ident_style = space
ident_size = 2
Just need to figure out the tests then i can merge this! |
Looks really promising 🙌 |
Trying to sort issue with named imports rollup/rollup#2521. We could use |
9424db7
to
f9bc34d
Compare
Hmm even when i disable treeshaking, the es output is still broken. The top two lines of the output file are:
I'm not sure why the second line is present since i included the treeshaking: false argument. Ill keep investigating |
Found a way around the treeshaking problem ;) |
Update: My 'genius' idea isn't testable 👎 |
Couldnt get around it, had to include the esModuleInterop |
Summary
fix: Removed xhr library in favour of ky, and switched request for got for a smaller package size and retry functionality #98
breaking: Removed dependency on FS. Now the Projects API takes in two arguments
projectId
andcontent
as well as an option fileName argumentTesting