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

[Idea]: use ES6 modules for running unit tests and benchmarks in web browsers #21

Open
kgryte opened this issue Jan 11, 2023 · 6 comments
Labels
difficulty: 3 Likely to be challenging but manageable. idea Potential GSoC project idea. priority: high High priority. tech: html/css Involves using HTML and CSS. tech: javascript Involves programming in JavaScript. tech: jsx/react Involves programming with React JSX. tech: nodejs Requires developing with Node.js.

Comments

@kgryte
Copy link
Member

kgryte commented Jan 11, 2023

Idea

Currently, when generating stdlib API documentation, we generate UMD bundles for unit tests and benchmarks. When a user navigates to our package documentation, they can load unit tests and benchmarks and have those run without needing to setup a local environment. The pain point here is that creating separate bundles for each package is time consuming and adds significant heft to the www repo.

The goal of this idea is to refactor the way we support unit tests and benchmarks to use ES6 modules and potentially skip bundling altogether. This has the downside of not supporting older browsers which don't support the <module> tag, but is probably fine considering that running package unit tests and benchmarks is likely a forward looking concern.

Expected Outcomes

Users will be able to run unit tests and benchmarks directly in their web browsers by navigating to project API documentation and what is loaded are ES6 modules, not UMD bundles.

Involved Software

No other software is necessary.

Prerequisite Knowledge

JavaScript, Node.js, HTML/CSS, JSX/React.

Difficulty

Intermediate.

Project Length

350 hours.

Potential Mentors

@kgryte @Planeshifter @steff456

@kgryte kgryte added idea Potential GSoC project idea. priority: normal Normal priority. difficulty: 3 Likely to be challenging but manageable. tech: javascript Involves programming in JavaScript. tech: nodejs Requires developing with Node.js. tech: html/css Involves using HTML and CSS. tech: jsx/react Involves programming with React JSX. labels Jan 11, 2023
@kgryte
Copy link
Member Author

kgryte commented Jan 30, 2024

@Planeshifter Now that we have UMD and ES Module builds in standalone repositories, this could be more straightforward, I believe, as we may be able to load directly using JSDelivr rather than the stdlib hosted server. What are your thoughts?

@Planeshifter
Copy link
Member

@kgryte Yes, should be fairly straightforward to load the ES modules from JSDelivr.
This project may be helped by writing own test runner as planned (#7).

@kgryte
Copy link
Member Author

kgryte commented Jan 30, 2024

Good point. We'd need to account for 3rd party dev dependencies (e.g., tape, proxyquire, and the like).

@kgryte kgryte added priority: high High priority. and removed priority: normal Normal priority. labels Feb 15, 2025
@kgryte
Copy link
Member Author

kgryte commented Feb 15, 2025

Marking this idea as higher priority, as the ability to run unit tests, examples, and benchmarks via ES modules could potentially drastically improve website build times and pave the way for nightly website builds.

If someone is interested in pursuing this idea, they are advised to spend time reading the current website code located in the stdlib-js/www repository. Your proposal should reflect our current technology stack, and you should describe the concrete steps necessary to achieve expected outcomes.

@kgryte
Copy link
Member Author

kgryte commented Feb 15, 2025

@Planeshifter We initially marked this as 350 hours. Given the prior efforts to create ES Module builds, is this an appropriate project length or could the expected outcomes be achieved in 90 or 175 hours?

@saurabhraghuvanshii

This comment has been minimized.

@stdlib-js stdlib-js locked and limited conversation to collaborators Mar 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
difficulty: 3 Likely to be challenging but manageable. idea Potential GSoC project idea. priority: high High priority. tech: html/css Involves using HTML and CSS. tech: javascript Involves programming in JavaScript. tech: jsx/react Involves programming with React JSX. tech: nodejs Requires developing with Node.js.
Projects
None yet
Development

No branches or pull requests

3 participants