elastic / elastic/synthetics

create separate bundles for external modules

Open
#596 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
80
Forks
49
Avg merge
2d 3h
Merged PRs (30d)
3

Description

  • With the support of bundling external packages, we bundle the included packages along with the source journey files to be able to run them via Heartbeat later without installing any packages. This is good, but it changes the source line numbers and column numbers of those particular journeys and might be a bad UX if we have to go back to the original source.

More details in here - https://github.com/elastic/synthetics/pull/580#pullrequestreview-1082955330

The ultimate goal of our push command is to replicate exactly how your folder structure is on your local and run the same inside HB when pushed. This would make it presentable in Kibana when we add unzipping support and allow users to view and edit monitors.

TLDR: If i push below example journey code

// examples/bundled-code/test.journey.ts
import { journey, step, monitor, expect } from "@elastic/synthetics";
import isPositive from "is-positive";
import leftpad from "leftpad";
import * as utils from "./utils";

journey("example journey", ({ page, params }) => {
  step("example step", () => {});
});

Our bundled zip folder should be in the below format.

examples/bundled-code/test.journey.ts
examples/bundled-code/utils.ts
examples/bundled-code/is-positive.js
examples/bundled-code/leftpad.js

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the push command's bundling flow and read the linked pull request review for the existing external-package behavior. Use the example in the issue as the acceptance case; done means the pushed zip preserves the journey and local utils while placing external modules such as is-positive.js and leftpad.js alongside them, without losing source structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.