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

Bundle /hoodie/client.js on demand #5

Closed
7 tasks
gr2m opened this issue May 18, 2016 · 1 comment
Closed
7 tasks

Bundle /hoodie/client.js on demand #5

gr2m opened this issue May 18, 2016 · 1 comment

Comments

@gr2m
Copy link
Member

gr2m commented May 18, 2016

This is a starter issue.

:octocat: Your First Pull Request?

We would like to take the opportunity to invite someone who did not yet contribute to Hoodie to work on this issue. Follow @YourFirstPR on Twitter for more of these issues across many open source projects :)

🤔 What you will need to know

JavaScript, Node.js, some hapi. Knowledge about browserify would be helpful but are not required.

❓ The Motivation

The Hoodie Client is a JavaScript library that gets loaded in the browser using a <script src="/hoodie/client.js> tag, just like jQuery. But unlike jQuery a Hoodie Client is always specific to its Hoodie Server, and must therefore be generated dynamically. We currently do that on every server start, which is quite resource intensive. Sometime the client doesn’t get loaded from server but is bundled into the frontend app, in that case it doesn’t need to be bundled at all.

🎯 The goal

Bundle the Hoodie Client the first with the first GET /hoodie/client.js request. Queue up all following requests until it’s generated and stored in .hoodie/client.js.

The logic for that is currently in hoodie/server/bundle-client.js, it gets required in hoodie/server/index.js

📋 Step by Step

  • claim this issue
    comment below. Once claimed we add you as contributor to this repository, so we can assign you to the ticket and you can start checking off the checkboxes below as you progress. We will also replace the up for grabs label with in progress.
  • Setup the hoodie repository locally and make sure that all tests pass
  • Implement the feature. Currently the /hoodie/client.js route is implemented in hoodie/server/plugins/public.js. We might want to move the logic for the hoodie client paths into an own plugin, maybe hoodie/server/plugins/client.js?
  • Commit with feat: bundle /hoodie/client.js on demand
    Don’t worry about wording or amount of commits. We will clean up everything before we merge :) Also feel free to commit work in progress work if you get stuck
  • Start a Pull Request. Mention closes hoodiehq/camp#5 in the description.
    If this is your first, welcome 🎉 😄 Here is a great tutorial on how to send a pull request
  • Bonus points if you also implement /hoodie/client.min.js, /hoodie/admin/client.js and /hoodie/admin/client.min.js, but we can also create follow up issues for it.
  • Done 👍 Replace the in progress label with ready. Ask in comments for a review :)

Ping us in the Hoodie Chat or on Twitter if you have any questions :)

@gr2m
Copy link
Member Author

gr2m commented Aug 11, 2016

done via hoodiehq/hoodie#538

@gr2m gr2m closed this as completed Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant